diff --git a/src/App/Container.purs b/src/App/Container.purs index a06348d..596ac73 100644 --- a/src/App/Container.purs +++ b/src/App/Container.purs @@ -495,8 +495,9 @@ handleAction = case _ of handleAction $ Log $ ErrorLog "TODO: received a GotPermissionCheck message." (AuthD.GotPermissionSet _) -> do handleAction $ Log $ ErrorLog "Received a GotPermissionSet message." - (AuthD.GotPasswordRecovered _) -> do + m@(AuthD.GotPasswordRecovered _) -> do handleAction $ Log $ SuccessLog "your new password is now valid!" + handleAction $ DispatchAuthDaemonMessage m m@(AuthD.GotMatchingUsers _) -> do { current_page } <- H.get case current_page of diff --git a/src/App/Page/Authentication.purs b/src/App/Page/Authentication.purs index c7d5e16..cedb25b 100644 --- a/src/App/Page/Authentication.purs +++ b/src/App/Page/Authentication.purs @@ -375,9 +375,13 @@ handleAction = case _ of -- Store the current tab we are on and restore it when we reload. sessionstorage <- H.liftEffect $ Window.sessionStorage =<< HTML.window _ <- case current_tab of - Auth -> H.liftEffect $ Storage.setItem "current-auth-tab" "Auth" sessionstorage + Auth -> do + H.modify_ \state -> state { authenticationForm { login = state.newPasswordForm.login } } + H.liftEffect $ Storage.setItem "current-auth-tab" "Auth" sessionstorage TabPasswordRecovery -> H.liftEffect $ Storage.setItem "current-auth-tab" "TabPasswordRecovery" sessionstorage - Recovery -> H.liftEffect $ Storage.setItem "current-auth-tab" "Recovery" sessionstorage + Recovery -> do + H.modify_ \state -> state { newPasswordForm { login = state.passwordRecoveryForm.login } } + H.liftEffect $ Storage.setItem "current-auth-tab" "Recovery" sessionstorage H.modify_ _ { current_tab = current_tab } handleQuery :: forall a m. MonadAff m => Query a -> H.HalogenM State Action () Output m (Maybe a) @@ -386,6 +390,8 @@ handleQuery = case _ of -- Error messages are simply logged (see the code in the Container component). MessageReceived message _ -> do case message of + AuthD.GotPasswordRecovered _ -> do + handleAction $ ChangeTab Auth AuthD.GotPasswordRecoverySent _ -> do handleAction $ ChangeTab Recovery _ -> do