From f9a471c5805a3769bfe96ce0a19533bbce366895 Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Thu, 21 Mar 2024 00:17:15 +0100 Subject: [PATCH] AskPasswordRecovery: user -> login. --- src/App/Container.purs | 4 ++-- src/App/Message/AuthenticationDaemon.purs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/App/Container.purs b/src/App/Container.purs index cf8c4ce..ad586f9 100644 --- a/src/App/Container.purs +++ b/src/App/Container.purs @@ -350,11 +350,11 @@ handleAction = case _ of AI.AskPasswordRecovery e -> case e of Left email -> do 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) Right login -> do 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) AI.PasswordRecovery login token pass -> do message <- H.liftEffect $ AuthD.serialize $ AuthD.MkPasswordRecovery diff --git a/src/App/Message/AuthenticationDaemon.purs b/src/App/Message/AuthenticationDaemon.purs index 4aaaf58..0b628b7 100644 --- a/src/App/Message/AuthenticationDaemon.purs +++ b/src/App/Message/AuthenticationDaemon.purs @@ -70,11 +70,11 @@ codecValidateUser {- 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. -} {- 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.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 -} type PasswordRecovery = { user :: String