diff --git a/Handler/YourAccount.hs b/Handler/YourAccount.hs
index 641a4b6..9807e8f 100644
--- a/Handler/YourAccount.hs
+++ b/Handler/YourAccount.hs
@@ -26,6 +26,7 @@ postYourAccountR :: Handler Html
postYourAccountR = do
((result, formWidget), formEnctype) <- runFormPost (yourAccountForm Nothing Nothing Nothing)
userId <- requireAuthId
+ user <- runDB $ get404 userId
let accountData = case result of
FormSuccess res -> Just res
_ -> Nothing
@@ -73,6 +74,7 @@ updatePassword _ Nothing = return ()
updatePassword userId (Just password) = do
encodedPassword <- liftIO $ makePassword (encodeUtf8 password) defaultStrength
runDB $ update userId [UserPassword =. Just (decodeUtf8 encodedPassword)]
+ setMessage $ toHtml ("Password set!" :: Text)
updateAvatar :: Key User -> Maybe FileInfo -> Handler ()
updateAvatar _ Nothing = return ()
@@ -140,7 +142,7 @@ passwordConfirmField = Field
, fieldView = \idAttr nameAttr otherAttrs _ _ ->
[whamlet|
-
confirm:
+
confirm new password:
|]
, fieldEnctype = UrlEncoded
diff --git a/messages/en.msg b/messages/en.msg
index 47c0f00..2b5ff16 100644
--- a/messages/en.msg
+++ b/messages/en.msg
@@ -25,4 +25,4 @@ CommentText: Write a comment
Send: Send
Avatar: avatar
About: about
-Password: password
+Password: new password
diff --git a/templates/homepage.hamlet b/templates/homepage.hamlet
index 9e40ab8..dee68c9 100644
--- a/templates/homepage.hamlet
+++ b/templates/homepage.hamlet
@@ -14,7 +14,7 @@
$nothing
- Please set up your password at your account so that you could log in when Persona authentication system.
+ Please set up your password at your account so that you could log in when Persona authentication system is shut down.
$maybe _ <- maybeLocalId
Go to the challenge list and choose a challenge for you!
diff --git a/templates/your-account.hamlet b/templates/your-account.hamlet
index 24caeeb..720ab60 100644
--- a/templates/your-account.hamlet
+++ b/templates/your-account.hamlet
@@ -2,6 +2,11 @@
Your account
+ $maybe _ <- userPassword user
+ $nothing
+
+
+ Please set up your password below so that you could log in when Persona authentication system is shut down.