From 5f27f2b10340320334f8d5b830af734bce967fe8 Mon Sep 17 00:00:00 2001 From: Jenni Nurmi Date: Wed, 6 Feb 2019 11:07:23 +0200 Subject: [PATCH] Remove error handling for unverified email from PasswordRecoveryPage --- .../PasswordRecoveryPage.js | 29 ++----------------- src/translations/en.json | 3 -- src/translations/es.json | 3 -- src/translations/fr.json | 3 -- src/util/errors.js | 8 ----- src/util/types.js | 2 -- 6 files changed, 2 insertions(+), 46 deletions(-) diff --git a/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js b/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js index 79ed79c6..48e923de 100644 --- a/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js +++ b/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js @@ -4,10 +4,7 @@ import { compose } from 'redux'; import { connect } from 'react-redux'; import { FormattedMessage, injectIntl, intlShape } from 'react-intl'; import { propTypes } from '../../util/types'; -import { - isPasswordRecoveryEmailNotFoundError, - isPasswordRecoveryEmailNotVerifiedError, -} from '../../util/errors'; +import { isPasswordRecoveryEmailNotFoundError } from '../../util/errors'; import { isScrollingDisabled } from '../../ducks/UI.duck'; import { Page, @@ -27,7 +24,6 @@ import { retypePasswordRecoveryEmail, clearPasswordRecoveryError, } from './PasswordRecoveryPage.duck'; -import DoorIcon from './DoorIcon'; import css from './PasswordRecoveryPage.css'; export const PasswordRecoveryPageComponent = props => { @@ -115,25 +111,6 @@ export const PasswordRecoveryPageComponent = props => { ); - const initialEmailText = {initialEmail}; - const emailNotVerifiedContent = ( -
- -

- -

-

- -

-

- -

-
- ); - const genericErrorContent = (
@@ -147,9 +124,7 @@ export const PasswordRecoveryPageComponent = props => { ); let content; - if (isPasswordRecoveryEmailNotVerifiedError(recoveryError)) { - content = emailNotVerifiedContent; - } else if (isPasswordRecoveryEmailNotFoundError(recoveryError)) { + if (isPasswordRecoveryEmailNotFoundError(recoveryError)) { content = submitEmailContent; } else if (recoveryError) { content = genericErrorContent; diff --git a/src/translations/en.json b/src/translations/en.json index 54762a51..98205b23 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -432,9 +432,6 @@ "PasswordRecoveryForm.sendInstructions": "Send instructions", "PasswordRecoveryPage.actionFailedMessage": "Something went wrong. Please refresh the page and try again.", "PasswordRecoveryPage.actionFailedTitle": "Whoops!", - "PasswordRecoveryPage.emailNotVerifiedContactAdmin": "To resolve the issue, please contact the Saunatime administrators.", - "PasswordRecoveryPage.emailNotVerifiedMessage": "Unfortunately, we cannot recover your password because your email address {initialEmailText} hasn't been verified.", - "PasswordRecoveryPage.emailNotVerifiedTitle": "We have some bad news", "PasswordRecoveryPage.emailSubmittedMessage": "The instructions for resetting your password have been sent to {submittedEmailText}.", "PasswordRecoveryPage.emailSubmittedTitle": "Check your inbox", "PasswordRecoveryPage.fixEmailInfo": "Whoops, typo in your email? {fixEmailLink}", diff --git a/src/translations/es.json b/src/translations/es.json index fe775c17..fdd1793a 100644 --- a/src/translations/es.json +++ b/src/translations/es.json @@ -432,9 +432,6 @@ "PasswordRecoveryForm.sendInstructions": "Enviar instrucciones", "PasswordRecoveryPage.actionFailedMessage": "Algo ha salido mal. Por favor, actualiza la página e inténtalo de nuevo.", "PasswordRecoveryPage.actionFailedTitle": "¡Ups!", - "PasswordRecoveryPage.emailNotVerifiedContactAdmin": "Para resolver el problema, contacta al equipo de Saunatime.", - "PasswordRecoveryPage.emailNotVerifiedMessage": "Desafortunadamente, no podemos recuperar tu contraseña porque tu dirección de correo electrónico {initialEmailText} no ha sido verificada.", - "PasswordRecoveryPage.emailNotVerifiedTitle": "Tenemos malas noticias", "PasswordRecoveryPage.emailSubmittedMessage": "Las instrucciones para restablecer tu contraseña han sido enviadas a {submittedEmailText}.", "PasswordRecoveryPage.emailSubmittedTitle": "Revisa tu buzón", "PasswordRecoveryPage.fixEmailInfo": "Ups, ¿has escrito correctamente tu correo? {fixEmailLink}", diff --git a/src/translations/fr.json b/src/translations/fr.json index 220016b5..b2aeede5 100644 --- a/src/translations/fr.json +++ b/src/translations/fr.json @@ -432,9 +432,6 @@ "PasswordRecoveryForm.sendInstructions": "Envoyer les instructions", "PasswordRecoveryPage.actionFailedMessage": "Quelque chose s'est mal passé. Veuillez essayer de nouveau.", "PasswordRecoveryPage.actionFailedTitle": "Oups!", - "PasswordRecoveryPage.emailNotVerifiedContactAdmin": "Pour résoudre le problème, veuillez contacter l'équipe Saunatime.", - "PasswordRecoveryPage.emailNotVerifiedMessage": "Hélas, nous ne pouvons pas réinitialiser votre mot de passe car votre adresse email {initialEmailText} n'a pas été vérifiée.", - "PasswordRecoveryPage.emailNotVerifiedTitle": "Mauvaise nouvelle", "PasswordRecoveryPage.emailSubmittedMessage": "Les instructions pour réinitialiser votre mot de passe ont été envoyées à {submittedEmailText}.", "PasswordRecoveryPage.emailSubmittedTitle": "Jetez un œil à votre boîte email", "PasswordRecoveryPage.fixEmailInfo": "Oups, une faute dans votre email ? {fixEmailLink}", diff --git a/src/util/errors.js b/src/util/errors.js index 903bfddc..4abc5af4 100644 --- a/src/util/errors.js +++ b/src/util/errors.js @@ -18,7 +18,6 @@ import { ERROR_CODE_CHARGE_ZERO_PAYIN, ERROR_CODE_EMAIL_TAKEN, ERROR_CODE_EMAIL_NOT_FOUND, - ERROR_CODE_EMAIL_NOT_VERIFIED, ERROR_CODE_TOO_MANY_VERIFICATION_REQUESTS, ERROR_CODE_UPLOAD_OVER_LIMIT, ERROR_CODE_MISSING_STRIPE_ACCOUNT, @@ -81,13 +80,6 @@ export const isUploadImageOverLimitError = error => export const isPasswordRecoveryEmailNotFoundError = error => hasErrorWithCode(error, ERROR_CODE_EMAIL_NOT_FOUND); -/** - * Check if the given API error (from `sdk.passwordReset.request()`) - * is due to the email not being verified, preventing the reset. - */ -export const isPasswordRecoveryEmailNotVerifiedError = error => - hasErrorWithCode(error, ERROR_CODE_EMAIL_NOT_VERIFIED); - /** * Check if the given API error (from `sdk.transaction.initiate()` or * `sdk.transaction.initiateSpeculative()`) is due to the listing diff --git a/src/util/types.js b/src/util/types.js index 5ab9070e..98f274d4 100644 --- a/src/util/types.js +++ b/src/util/types.js @@ -371,7 +371,6 @@ export const ERROR_CODE_CHARGE_ZERO_PAYIN = 'transaction-charge-zero-payin'; export const ERROR_CODE_CHARGE_ZERO_PAYOUT = 'transaction-charge-zero-payout'; export const ERROR_CODE_EMAIL_TAKEN = 'email-taken'; export const ERROR_CODE_EMAIL_NOT_FOUND = 'email-not-found'; -export const ERROR_CODE_EMAIL_NOT_VERIFIED = 'email-unverified'; export const ERROR_CODE_TOO_MANY_VERIFICATION_REQUESTS = 'email-too-many-verification-requests'; export const ERROR_CODE_UPLOAD_OVER_LIMIT = 'request-upload-over-limit'; export const ERROR_CODE_VALIDATION_INVALID_PARAMS = 'validation-invalid-params'; @@ -390,7 +389,6 @@ const ERROR_CODES = [ ERROR_CODE_CHARGE_ZERO_PAYOUT, ERROR_CODE_EMAIL_TAKEN, ERROR_CODE_EMAIL_NOT_FOUND, - ERROR_CODE_EMAIL_NOT_VERIFIED, ERROR_CODE_TOO_MANY_VERIFICATION_REQUESTS, ERROR_CODE_UPLOAD_OVER_LIMIT, ERROR_CODE_VALIDATION_INVALID_PARAMS,