Skip to content

Commit

Permalink
Merge pull request Expensify#8472 from Expensify/john-add-2fa-error
Browse files Browse the repository at this point in the history
Add flow in which 2FA code is incorrect and inform user
  • Loading branch information
johnmlee101 authored Apr 11, 2022
2 parents 43910fe + 88e1b64 commit 1d030b9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ export default {
error: {
incorrectPassword: 'Incorrect password. Please try again.',
incorrectLoginOrPassword: 'Incorrect login or password. Please try again.',
incorrect2fa: 'Incorrect two factor authentication code. Please try again.',
twoFactorAuthenticationEnabled: 'You have 2FA enabled on this account. Please sign in using your email or phone number.',
invalidLoginOrPassword: 'Invalid login or password. Please try again or reset your password.',
unableToResetPassword: 'We were unable to change your password. This is likely due to an expired password reset link in an old password reset email. We have emailed you a new link so you can try again. Check your Inbox and your Spam folder; it should arrive in just a few minutes.',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ export default {
error: {
incorrectPassword: 'Contraseña incorrecta. Por favor inténtalo de nuevo.',
incorrectLoginOrPassword: 'Usuario o clave incorrectos. Por favor inténtalo de nuevo',
incorrect2fa: 'Código de autenticación de 2 factores incorrecto. Por favor inténtalo de nuevo',
twoFactorAuthenticationEnabled: 'Tienes autenticación de 2 factores activada en esta cuenta. Por favor conéctate usando su email o número de teléfono',
invalidLoginOrPassword: 'Usuario o clave incorrectos. Por favor inténtalo de nuevo o resetea tu clave',
unableToResetPassword: 'No pudimos cambiar tu clave. Probablemente porque el enlace para resetear la clave ha expirado. Te hemos enviado un nuevo enlace. Chequea tu bandeja de entrada y tu carpeta de Spam',
Expand Down
3 changes: 3 additions & 0 deletions src/libs/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ function Authenticate(parameters) {
}
throw new Error('passwordForm.error.twoFactorAuthenticationEnabled');
case 403:
if (response.message === 'Invalid code') {
throw new Error('passwordForm.error.incorrect2fa');
}
throw new Error('passwordForm.error.invalidLoginOrPassword');
case 404:
throw new Error('passwordForm.error.unableToResetPassword');
Expand Down

0 comments on commit 1d030b9

Please sign in to comment.