From cf0fe9015660ca5d1a551eb475e08b40c033e3ba Mon Sep 17 00:00:00 2001 From: Akshaya Salvi Date: Mon, 6 Dec 2021 22:14:58 +0530 Subject: [PATCH] Rolledback unvalidated account changed and fixed validation link message --- src/languages/en.js | 2 +- src/languages/es.js | 2 +- src/libs/actions/Session/index.js | 4 +++- src/pages/signin/ResendValidationForm.js | 6 ++++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/languages/en.js b/src/languages/en.js index 5b2995ec4b2c..f683e5c68855 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -405,7 +405,7 @@ export default { linkHasBeenResent: 'Link has been re-sent', weSentYouMagicSignInLink: ({login}) => `We've sent a magic sign in link to ${login}. Check your Inbox and your Spam folder and wait 5-10 minutes before trying again.`, resendLink: 'Resend link', - validationCodeFailedMessage: 'It looks like there was an error with your validation link. Either the validation link has expired, or your account does not exist.', + validationCodeFailedMessage: 'It looks like there was an error with your validation link or it has expired.', unvalidatedAccount: 'This account exists but isn\'t validated, please check your inbox for your magic link.', newAccount: ({login, loginType}) => `Welcome ${login}, it's always great to see a new face around here! Please check your ${loginType} for a magic link to validate your account.`, }, diff --git a/src/languages/es.js b/src/languages/es.js index 5af2084806a8..a48bf53eefd0 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -405,7 +405,7 @@ export default { linkHasBeenResent: 'El enlace se ha reenviado', weSentYouMagicSignInLink: ({login}) => `Hemos enviado un enlace mágico de inicio de sesión a ${login}. Verifica tu bandeja de entrada y tu carpeta de correo no deseado y espera de 5 a 10 minutos antes de intentarlo de nuevo.`, resendLink: 'Reenviar enlace', - validationCodeFailedMessage: 'Parece que hubo un error con el enlace de validación. El enlace de validación ha caducado o tu cuenta no existe', + validationCodeFailedMessage: 'Parece que hubo un error con el enlace de validación o ha caducado.', unvalidatedAccount: 'Esta cuenta existe pero no está validada, por favor busca el enlace mágico en tu bandeja de entrada', newAccount: ({login, loginType}) => `¡Bienvenido ${login}, es genial ver una cara nueva por aquí! En tu ${loginType} encontrarás un enlace para validar tu cuenta, por favor, revísalo`, }, diff --git a/src/libs/actions/Session/index.js b/src/libs/actions/Session/index.js index 7d873497d2a5..52e9e5689d78 100644 --- a/src/libs/actions/Session/index.js +++ b/src/libs/actions/Session/index.js @@ -318,7 +318,9 @@ function setPassword(password, validateCode, accountID) { } const login = lodashGet(response, 'data.email', null); - Onyx.merge(ONYXKEYS.ACCOUNT, {validated: false, validateCodeExpired: true, error: Localize.translateLocal('setPasswordPage.accountNotValidated')}); + Onyx.merge(ONYXKEYS.ACCOUNT, { + validated: true, accountExists: true, validateCodeExpired: true, error: Localize.translateLocal('setPasswordPage.accountNotValidated'), + }); if (login) { Onyx.merge(ONYXKEYS.CREDENTIALS, {login}); } diff --git a/src/pages/signin/ResendValidationForm.js b/src/pages/signin/ResendValidationForm.js index 92952b04f434..95496b217c72 100755 --- a/src/pages/signin/ResendValidationForm.js +++ b/src/pages/signin/ResendValidationForm.js @@ -87,7 +87,7 @@ class ResendValidationForm extends React.Component { } render() { - const isNewAccount = !this.props.account.accountExists && !this.props.account.validateCodeExpired; + const isNewAccount = !this.props.account.accountExists; const isOldUnvalidatedAccount = this.props.account.accountExists && !this.props.account.validated; const isSMSLogin = Str.isSMSLogin(this.props.credentials.login); const login = isSMSLogin ? this.props.toLocalPhone(Str.removeSMSDomain(this.props.credentials.login)) : this.props.credentials.login; @@ -99,7 +99,9 @@ class ResendValidationForm extends React.Component { login, loginType, }); - } else if (isOldUnvalidatedAccount || this.props.account.validateCodeExpired) { + } else if (isOldUnvalidatedAccount) { + message = this.props.translate('resendValidationForm.unvalidatedAccount'); + } else if (this.props.account.validateCodeExpired) { message = this.props.translate('resendValidationForm.validationCodeFailedMessage'); } else { message = this.props.translate('resendValidationForm.weSentYouMagicSignInLink', {