setting up an account more intuitive

This commit is contained in:
Filip Gralinski 2017-09-23 15:30:10 +02:00
parent e3a3f28da0
commit 7a9eb28b48
2 changed files with 8 additions and 2 deletions

View File

@ -112,7 +112,7 @@ doResetPassword' :: Bool -> Text -> Key User -> Text -> Handler Html
doResetPassword' True _ userId password = do
updatePassword userId (Just password)
runDB $ update userId removeVerificationKeyStatement
setMessage $ toHtml ("Password set! You can log in now." :: Text)
setMessage $ toHtml ("Password set! Now, you can log in with your e-mail address." :: Text)
redirect HomeR
doResetPassword' False key _ _ = do

View File

@ -18,6 +18,12 @@ getHomeR = do
let maybeLocalId = case maybeUser of
Just user -> userLocalId $ entityVal user
Nothing -> Nothing
if maybe False ((\u -> isNothing (userLocalId u) && isNothing (userName u)) . entityVal) maybeUser
then
do
setMessage $ toHtml ("First, set up your name and/or ID!" :: Text)
redirect $ YourAccountR
else
defaultLayout $ do
aDomId <- newIdent
setTitle "Welcome To Gonito.net!"