AskPasswordRecovery: user -> login.

This commit is contained in:
Philippe Pittoli 2024-03-21 00:17:15 +01:00
parent 0dce7e5762
commit f9a471c580
2 changed files with 4 additions and 4 deletions

View File

@ -350,11 +350,11 @@ handleAction = case _ of
AI.AskPasswordRecovery e -> case e of AI.AskPasswordRecovery e -> case e of
Left email -> do Left email -> do
message <- H.liftEffect $ AuthD.serialize $ message <- H.liftEffect $ AuthD.serialize $
AuthD.MkAskPasswordRecovery { user: Nothing, email: Just (Email.Email email) } AuthD.MkAskPasswordRecovery { login: Nothing, email: Just (Email.Email email) }
H.tell _ws_auth unit (WS.ToSend message) H.tell _ws_auth unit (WS.ToSend message)
Right login -> do Right login -> do
message <- H.liftEffect $ AuthD.serialize $ message <- H.liftEffect $ AuthD.serialize $
AuthD.MkAskPasswordRecovery { user: (Just login), email: Nothing } AuthD.MkAskPasswordRecovery { login: (Just login), email: Nothing }
H.tell _ws_auth unit (WS.ToSend message) H.tell _ws_auth unit (WS.ToSend message)
AI.PasswordRecovery login token pass -> do AI.PasswordRecovery login token pass -> do
message <- H.liftEffect $ AuthD.serialize $ AuthD.MkPasswordRecovery message <- H.liftEffect $ AuthD.serialize $ AuthD.MkPasswordRecovery

View File

@ -70,11 +70,11 @@ codecValidateUser
{- NOTE: "user" attribute for both PasswordRecovery and AskPasswordRecovery could be UserID, {- NOTE: "user" attribute for both PasswordRecovery and AskPasswordRecovery could be UserID,
but they'll be used as login since the user has to type it. -} but they'll be used as login since the user has to type it. -}
{- 3 -} {- 3 -}
type AskPasswordRecovery = { user :: Maybe String, email :: Maybe Email.Email } type AskPasswordRecovery = { login :: Maybe String, email :: Maybe Email.Email }
codecAskPasswordRecovery ∷ CA.JsonCodec AskPasswordRecovery codecAskPasswordRecovery ∷ CA.JsonCodec AskPasswordRecovery
codecAskPasswordRecovery codecAskPasswordRecovery
= CA.object "AskPasswordRecovery" = CA.object "AskPasswordRecovery"
(CAR.record { user: CAR.optional CA.string, email: CAR.optional Email.codec }) (CAR.record { login: CAR.optional CA.string, email: CAR.optional Email.codec })
{- 4 -} {- 4 -}
type PasswordRecovery = { user :: String type PasswordRecovery = { user :: String