yesodweb / yesod-scaffold

The Yesod scaffolding, with branches for different versions.
MIT License
76 stars 39 forks source link

Patch templates so they don't require CSRF #128

Closed yamadapc closed 8 years ago

yamadapc commented 8 years ago

The Handler.Comment specs fail, because of a call to addTokenFromCookie, but no defaultCsrfMiddleware on Foundation.hs [1]

This removes all calls to addTokenFromCookie from the yesod templates' tests.

This closes commercialhaskell/stack-templates#71 and is related to PR commercialhaskell/stack-templates#72.

[1] - https://github.com/commercialhaskell/stack-templates/blob/master/yesod-postgres.hsfiles#L289

Also could be fixed with as mentioned in commercialhaskell/stack-templates#71:

-    yesodMiddleware = defaultYesodMiddleware
+    yesodMiddleware = defaultYesodMiddleware . defaultCsrfMiddleware
MaxGabriel commented 8 years ago

This is great, thanks for making this fix @yamadapc!