Password recovery: new text and automatic tab change when password is sent.
This commit is contained in:
parent
f9a471c580
commit
a5756e41af
@ -520,8 +520,9 @@ handleAction = case _ of
|
|||||||
(AuthD.GotError errmsg) -> do
|
(AuthD.GotError errmsg) -> do
|
||||||
handleAction $ Log $ ErrorLog $ " generic error message: "
|
handleAction $ Log $ ErrorLog $ " generic error message: "
|
||||||
<> maybe "server didn't tell why" (\v -> v) errmsg.reason
|
<> maybe "server didn't tell why" (\v -> v) errmsg.reason
|
||||||
(AuthD.GotPasswordRecoverySent _) -> do
|
m@(AuthD.GotPasswordRecoverySent _) -> do
|
||||||
handleAction $ Log $ SuccessLog $ "Password recovery: email sent!"
|
handleAction $ Log $ SuccessLog $ "Password recovery: email sent!"
|
||||||
|
handleAction $ DispatchAuthDaemonMessage m
|
||||||
(AuthD.GotErrorPasswordTooShort _) -> do
|
(AuthD.GotErrorPasswordTooShort _) -> do
|
||||||
handleAction $ Log $ ErrorLog "Password too short!"
|
handleAction $ Log $ ErrorLog "Password too short!"
|
||||||
(AuthD.GotErrorMailRequired _) -> do
|
(AuthD.GotErrorMailRequired _) -> do
|
||||||
@ -566,6 +567,7 @@ handleAction = case _ of
|
|||||||
DispatchAuthDaemonMessage message -> do
|
DispatchAuthDaemonMessage message -> do
|
||||||
{ current_page } <- H.get
|
{ current_page } <- H.get
|
||||||
case current_page of
|
case current_page of
|
||||||
|
Authentication -> H.tell _ai unit (AI.MessageReceived message)
|
||||||
Administration -> H.tell _admini unit (AdminInterface.MessageReceived message)
|
Administration -> H.tell _admini unit (AdminInterface.MessageReceived message)
|
||||||
_ -> handleAction $ Log $ SystemLog "unexpected message from authd"
|
_ -> handleAction $ Log $ SystemLog "unexpected message from authd"
|
||||||
pure unit
|
pure unit
|
||||||
|
@ -203,8 +203,20 @@ render { wsUp, current_tab, authenticationForm, passwordRecoveryForm, newPasswor
|
|||||||
<> " (currently: " <> show n <> ")"
|
<> " (currently: " <> show n <> ")"
|
||||||
|
|
||||||
auth_form = [ Bulma.h3 "Authentication", render_auth_form ]
|
auth_form = [ Bulma.h3 "Authentication", render_auth_form ]
|
||||||
passrecovery_form = [ Bulma.h3 "Password Recovery", render_password_recovery_form ]
|
passrecovery_form =
|
||||||
newpass_form = [ Bulma.h3 "New password", render_new_password_form ]
|
[ Bulma.h3 "Password Recovery"
|
||||||
|
, Bulma.div_content
|
||||||
|
[ Bulma.p "You forgot your password? Ask for a password recovery token!"
|
||||||
|
]
|
||||||
|
, render_password_recovery_form
|
||||||
|
]
|
||||||
|
newpass_form =
|
||||||
|
[ Bulma.h3 "You got the recovery mail and have a token"
|
||||||
|
, Bulma.div_content
|
||||||
|
[ Bulma.p "Nice! You get to chose your new password."
|
||||||
|
]
|
||||||
|
, render_new_password_form
|
||||||
|
]
|
||||||
|
|
||||||
should_be_disabled = (if wsUp then (HP.enabled true) else (HP.disabled true))
|
should_be_disabled = (if wsUp then (HP.enabled true) else (HP.disabled true))
|
||||||
|
|
||||||
@ -374,6 +386,8 @@ handleQuery = case _ of
|
|||||||
-- Error messages are simply logged (see the code in the Container component).
|
-- Error messages are simply logged (see the code in the Container component).
|
||||||
MessageReceived message _ -> do
|
MessageReceived message _ -> do
|
||||||
case message of
|
case message of
|
||||||
|
AuthD.GotPasswordRecoverySent _ -> do
|
||||||
|
handleAction $ ChangeTab Recovery
|
||||||
_ -> do
|
_ -> do
|
||||||
H.raise $ Log $ ErrorLog $ "Message not handled in AuthenticationInterface."
|
H.raise $ Log $ ErrorLog $ "Message not handled in AuthenticationInterface."
|
||||||
pure Nothing
|
pure Nothing
|
||||||
|
Loading…
Reference in New Issue
Block a user