Merge pull request #1205 from league/master

Provide CSRF token in Dummy login form
This commit is contained in:
Maximilian Tagher 2016-04-03 11:21:19 -07:00
commit 93039dfc7c
3 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,7 @@
## 1.4.13.1
* Add CSRF token to login form from `Yesod.Auth.Dummy` [#1205](https://github.com/yesodweb/yesod/pull/1205)
## 1.4.13
* Add a CSRF token to the login form from `Yesod.Auth.Hardcoded`, making it compatible with the CSRF middleware [#1161](https://github.com/yesodweb/yesod/pull/1161)

View File

@ -20,10 +20,13 @@ authDummy =
lift $ setCredsRedirect $ Creds "dummy" ident []
dispatch _ _ = notFound
url = PluginR "dummy" []
login authToMaster =
login authToMaster = do
request <- getRequest
toWidget [hamlet|
$newline never
<form method="post" action="@{authToMaster url}">
$maybe t <- reqToken request
<input type=hidden name=#{defaultCsrfParamName} value=#{t}>
Your new identifier is: #
<input type="text" name="ident">
<input type="submit" value="Dummy Login">

View File

@ -1,5 +1,5 @@
name: yesod-auth
version: 1.4.13
version: 1.4.13.1
license: MIT
license-file: LICENSE
author: Michael Snoyman, Patrick Brisbin