From 7a9eb28b484c24ec77342957f66893421e12ef89 Mon Sep 17 00:00:00 2001 From: Filip Gralinski Date: Sat, 23 Sep 2017 15:30:10 +0200 Subject: [PATCH] setting up an account more intuitive --- Handler/AccountReset.hs | 2 +- Handler/Home.hs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Handler/AccountReset.hs b/Handler/AccountReset.hs index b189f6f..9d8ce14 100644 --- a/Handler/AccountReset.hs +++ b/Handler/AccountReset.hs @@ -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 diff --git a/Handler/Home.hs b/Handler/Home.hs index 310f5d2..ab3c15b 100644 --- a/Handler/Home.hs +++ b/Handler/Home.hs @@ -18,7 +18,13 @@ getHomeR = do let maybeLocalId = case maybeUser of Just user -> userLocalId $ entityVal user Nothing -> Nothing - defaultLayout $ do + 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!" $(widgetFile "homepage")