Permalink
Browse files

Accept "on" value for remember me checkbox input value

Accept a value of "on" for login screen's "remember me" input value.
This is what gets sent as default by the browser when an
<input type="checkbox"> is checked.

Previously only "1" was accepted which meant checkboxes would need to
explicitly specify a value="1" in their definition.

Fixes #96
  • Loading branch information...
1 parent 33c07c1 commit a9dd3635df1c37b6b72b928da046bd38c935e82f @nurpax nurpax committed Dec 3, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/Snap/Snaplet/Auth/Handlers.hs
@@ -447,7 +447,7 @@ loginUser' unf pwdf remf = do
(runMaybeT $
do field <- MaybeT $ return remf
value <- MaybeT $ getParam field
- return $ value == "1")
+ return $ value == "1" || value == "on")
password <- noteT PasswordMissing $ hoistMaybe mbPassword
username <- noteT UsernameMissing $ hoistMaybe mbUsername

0 comments on commit a9dd363

Please sign in to comment.