Commit c4cb4ae4 authored by Henri Jones's avatar Henri Jones

Move passphrase handler logged-in redirect to AuthSite

parent 1cc349c2
Pipeline #569 passed with stages
in 7 minutes and 56 seconds
......@@ -417,9 +417,13 @@ postCreateAccountR = do
res
-- | ResetPassphrase page
getResetPassphraseR :: (Yesod m, RenderMessage m FormMessage, AuthMaster m)
=> HandlerT AuthSite (HandlerT m IO) Html
getResetPassphraseR = lift resetPassphraseHandler
getResetPassphraseR :: (AuthMaster master
,YesodPersist master
,YesodPersistBackend master ~ SqlBackend)
=> HandlerT AuthSite (HandlerT master IO) Html
getResetPassphraseR = lift $ do
r <- postLoginRoute <$> getYesod
maybeAuth >>= maybe resetPassphraseHandler (const (redirect r))
postResetPassphraseR :: (Yesod master
,AuthMaster master
......
......@@ -141,14 +141,11 @@ instance AuthMaster App where
$(widgetFile "page/auth/verify-account")
where af = [("autofocus","true")]
resetPassphraseHandler =
maybeAuth >>= maybe reset (const (redirect DashboardR))
where
reset = do
(loginFields, enctype) <- generateFormPost (renderDivs createCredentialsForm)
navbarLayout "page/auth/reset-passphrase" $ do
setTitle "Passphrase Reset — Snowdrift.coop"
$(widgetFile "page/auth/reset-passphrase")
resetPassphraseHandler = do
(loginFields, enctype) <- generateFormPost (renderDivs credentialsForm)
navbarLayout "page/auth/reset-passphrase" $ do
setTitle "Passphrase Reset — Snowdrift.coop"
$(widgetFile "page/auth/reset-passphrase")
sendAuthEmail to msg = do
$logDebugSH msg
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment