Skip to content

Commit

Permalink
Rolledback unvalidated account changed and fixed validation link message
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayasalvi committed Dec 6, 2021
1 parent e486081 commit cf0fe90
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.`,
},
Expand Down
2 changes: 1 addition & 1 deletion src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
},
Expand Down
4 changes: 3 additions & 1 deletion src/libs/actions/Session/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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});
}
Expand Down
6 changes: 4 additions & 2 deletions src/pages/signin/ResendValidationForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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', {
Expand Down

0 comments on commit cf0fe90

Please sign in to comment.