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 ...@@ -417,9 +417,13 @@ postCreateAccountR = do
res res
-- | ResetPassphrase page -- | ResetPassphrase page
getResetPassphraseR :: (Yesod m, RenderMessage m FormMessage, AuthMaster m) getResetPassphraseR :: (AuthMaster master
=> HandlerT AuthSite (HandlerT m IO) Html ,YesodPersist master
getResetPassphraseR = lift resetPassphraseHandler ,YesodPersistBackend master ~ SqlBackend)
=> HandlerT AuthSite (HandlerT master IO) Html
getResetPassphraseR = lift $ do
r <- postLoginRoute <$> getYesod
maybeAuth >>= maybe resetPassphraseHandler (const (redirect r))
postResetPassphraseR :: (Yesod master postResetPassphraseR :: (Yesod master
,AuthMaster master ,AuthMaster master
......
...@@ -141,14 +141,11 @@ instance AuthMaster App where ...@@ -141,14 +141,11 @@ instance AuthMaster App where
$(widgetFile "page/auth/verify-account") $(widgetFile "page/auth/verify-account")
where af = [("autofocus","true")] where af = [("autofocus","true")]
resetPassphraseHandler = resetPassphraseHandler = do
maybeAuth >>= maybe reset (const (redirect DashboardR)) (loginFields, enctype) <- generateFormPost (renderDivs credentialsForm)
where navbarLayout "page/auth/reset-passphrase" $ do
reset = do setTitle "Passphrase Reset — Snowdrift.coop"
(loginFields, enctype) <- generateFormPost (renderDivs createCredentialsForm) $(widgetFile "page/auth/reset-passphrase")
navbarLayout "page/auth/reset-passphrase" $ do
setTitle "Passphrase Reset — Snowdrift.coop"
$(widgetFile "page/auth/reset-passphrase")
sendAuthEmail to msg = do sendAuthEmail to msg = do
$logDebugSH msg $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