diff --git a/api/lib/domain/usecases/create-and-reconcile-user-to-organization-learner.js b/api/lib/domain/usecases/create-and-reconcile-user-to-organization-learner.js index ca953d85101..9a2e1a51b9a 100644 --- a/api/lib/domain/usecases/create-and-reconcile-user-to-organization-learner.js +++ b/api/lib/domain/usecases/create-and-reconcile-user-to-organization-learner.js @@ -2,6 +2,7 @@ import lodash from 'lodash'; const { isNil } = lodash; import { createAccountCreationEmail } from '../../../src/identity-access-management/domain/emails/create-account-creation.email.js'; +import { InvalidOrAlreadyUsedEmailError } from '../../../src/identity-access-management/domain/errors.js'; import { User } from '../../../src/identity-access-management/domain/models/User.js'; import { STUDENT_RECONCILIATION_ERRORS } from '../../../src/shared/domain/constants.js'; import { EntityValidationError } from '../../../src/shared/domain/errors.js'; @@ -119,6 +120,9 @@ function _createDomainUser(userAttributes) { } function _manageEmailAvailabilityError(error) { + if (error instanceof InvalidOrAlreadyUsedEmailError) { + error = new AlreadyRegisteredEmailError(); + } return _manageError( error, AlreadyRegisteredEmailError, diff --git a/api/src/identity-access-management/application/http-error-mapper-configuration.js b/api/src/identity-access-management/application/http-error-mapper-configuration.js index 91c07fabb5a..413466f9ed3 100644 --- a/api/src/identity-access-management/application/http-error-mapper-configuration.js +++ b/api/src/identity-access-management/application/http-error-mapper-configuration.js @@ -3,6 +3,7 @@ import { DomainErrorMappingConfiguration } from '../../shared/application/models import { AuthenticationKeyExpired, DifferentExternalIdentifierError, + InvalidOrAlreadyUsedEmailError, MissingOrInvalidCredentialsError, MissingUserAccountError, PasswordNotMatching, @@ -20,6 +21,10 @@ const authenticationDomainErrorMappingConfiguration = [ name: DifferentExternalIdentifierError.name, httpErrorFn: (error) => new HttpErrors.ConflictError(error.message), }, + { + name: InvalidOrAlreadyUsedEmailError.name, + httpErrorFn: (error) => new HttpErrors.BadRequestError(error.message, error.code), + }, { name: MissingOrInvalidCredentialsError.name, httpErrorFn: () => diff --git a/api/src/identity-access-management/domain/errors.js b/api/src/identity-access-management/domain/errors.js index 42ef17fb588..a598e02a9cc 100644 --- a/api/src/identity-access-management/domain/errors.js +++ b/api/src/identity-access-management/domain/errors.js @@ -14,6 +14,12 @@ class DifferentExternalIdentifierError extends DomainError { } } +class InvalidOrAlreadyUsedEmailError extends DomainError { + constructor(message = 'Adresse e-mail invalide ou déjà utilisée', code = 'INVALID_OR_ALREADY_USED_EMAIL') { + super(message, code); + } +} + class OrganizationLearnerNotBelongToOrganizationIdentityError extends DomainError { constructor(message = 'Organization Learner identity does not belong to Organization Identity') { super(message); @@ -74,6 +80,7 @@ class UserShouldChangePasswordError extends DomainError { export { AuthenticationKeyExpired, DifferentExternalIdentifierError, + InvalidOrAlreadyUsedEmailError, MissingOrInvalidCredentialsError, MissingUserAccountError, OrganizationLearnerIdentityNotFoundError, diff --git a/api/src/identity-access-management/domain/usecases/create-user.usecase.js b/api/src/identity-access-management/domain/usecases/create-user.usecase.js index 431f36c8844..742c7717f31 100644 --- a/api/src/identity-access-management/domain/usecases/create-user.usecase.js +++ b/api/src/identity-access-management/domain/usecases/create-user.usecase.js @@ -1,5 +1,5 @@ +import { InvalidOrAlreadyUsedEmailError } from '../../../identity-access-management/domain/errors.js'; import { withTransaction } from '../../../shared/domain/DomainTransaction.js'; -import { AlreadyRegisteredEmailError } from '../../../shared/domain/errors.js'; import { EntityValidationError } from '../../../shared/domain/errors.js'; import { urlBuilder } from '../../../shared/infrastructure/utils/url-builder.js'; import { createAccountCreationEmail } from '../emails/create-account-creation.email.js'; @@ -90,7 +90,7 @@ export { createUser }; * @private */ function _manageEmailAvailabilityError(error) { - return _manageError(error, AlreadyRegisteredEmailError, 'email', 'ALREADY_REGISTERED_EMAIL'); + return _manageError(error, InvalidOrAlreadyUsedEmailError, 'email', 'INVALID_OR_ALREADY_USED_EMAIL'); } /** diff --git a/api/src/identity-access-management/infrastructure/repositories/user.repository.js b/api/src/identity-access-management/infrastructure/repositories/user.repository.js index 97df84ee5bb..05d4adf1c62 100644 --- a/api/src/identity-access-management/infrastructure/repositories/user.repository.js +++ b/api/src/identity-access-management/infrastructure/repositories/user.repository.js @@ -1,4 +1,5 @@ import { knex } from '../../../../db/knex-database-connection.js'; +import { InvalidOrAlreadyUsedEmailError } from '../../../identity-access-management/domain/errors.js'; import * as organizationFeaturesApi from '../../../organizational-entities/application/api/organization-features-api.js'; import { Organization } from '../../../organizational-entities/domain/models/Organization.js'; import { OrganizationLearnerForAdmin } from '../../../prescription/learner-management/domain/read-models/OrganizationLearnerForAdmin.js'; @@ -6,7 +7,6 @@ import * as organizationLearnerImportFormatRepository from '../../../prescriptio import { DomainTransaction } from '../../../shared/domain/DomainTransaction.js'; import { AlreadyExistingEntityError, - AlreadyRegisteredEmailError, AlreadyRegisteredUsernameError, UserNotFoundError, } from '../../../shared/domain/errors.js'; @@ -249,7 +249,7 @@ const updateWithEmailConfirmed = function ({ id, userAttributes }) { const checkIfEmailIsAvailable = async function (email) { const existingUserEmail = await knex('users').whereRaw('LOWER("email") = ?', email.toLowerCase()).first(); - if (existingUserEmail) throw new AlreadyRegisteredEmailError(); + if (existingUserEmail) throw new InvalidOrAlreadyUsedEmailError(); return email; }; diff --git a/api/tests/identity-access-management/acceptance/application/account-recovery/account-recovery.route.test.js b/api/tests/identity-access-management/acceptance/application/account-recovery/account-recovery.route.test.js index 69f7a421b96..ff78a18b601 100644 --- a/api/tests/identity-access-management/acceptance/application/account-recovery/account-recovery.route.test.js +++ b/api/tests/identity-access-management/acceptance/application/account-recovery/account-recovery.route.test.js @@ -234,7 +234,7 @@ describe('Acceptance | Identity Access Management | Application | Route | accoun // then expect(response.statusCode).to.equal(400); - expect(response.result.errors[0].detail).to.equal('Cette adresse e-mail est déjà utilisée.'); + expect(response.result.errors[0].detail).to.equal('Adresse e-mail invalide ou déjà utilisée'); }); }); }); diff --git a/api/tests/identity-access-management/acceptance/application/user/user.route.test.js b/api/tests/identity-access-management/acceptance/application/user/user.route.test.js index 88c9942861d..9f0bbf9e8b4 100644 --- a/api/tests/identity-access-management/acceptance/application/user/user.route.test.js +++ b/api/tests/identity-access-management/acceptance/application/user/user.route.test.js @@ -734,7 +734,7 @@ describe('Acceptance | Identity Access Management | Application | Route | User', // then expect(response.statusCode).to.equal(400); - expect(response.result.errors[0].detail).to.equal('Cette adresse e-mail est déjà utilisée.'); + expect(response.result.errors[0].detail).to.equal('Adresse e-mail invalide ou déjà utilisée'); }); it('should return 403 if requested user is not the same as authenticated user', async function () { diff --git a/api/tests/identity-access-management/integration/domain/usecases/update-user-email-with-validation.usecase.test.js b/api/tests/identity-access-management/integration/domain/usecases/update-user-email-with-validation.usecase.test.js index 8788b024e71..11f91ec39bb 100644 --- a/api/tests/identity-access-management/integration/domain/usecases/update-user-email-with-validation.usecase.test.js +++ b/api/tests/identity-access-management/integration/domain/usecases/update-user-email-with-validation.usecase.test.js @@ -1,10 +1,10 @@ import { expect } from 'chai'; +import { InvalidOrAlreadyUsedEmailError } from '../../../../../src/identity-access-management/domain/errors.js'; import { EventLoggingJob } from '../../../../../src/identity-access-management/domain/models/jobs/EventLoggingJob.js'; import { usecases } from '../../../../../src/identity-access-management/domain/usecases/index.js'; import { userEmailRepository } from '../../../../../src/identity-access-management/infrastructure/repositories/user-email.repository.js'; import { - AlreadyRegisteredEmailError, EmailModificationDemandNotFoundOrExpiredError, InvalidVerificationCodeError, UserNotAuthorizedToUpdateEmailError, @@ -137,7 +137,7 @@ describe('Integration | Identity Access Management | Domain | UseCase | updateUs }); // then - expect(error).to.be.instanceOf(AlreadyRegisteredEmailError); + expect(error).to.be.instanceOf(InvalidOrAlreadyUsedEmailError); }); }); }); diff --git a/api/tests/identity-access-management/integration/infrastructure/repositories/user.repository.test.js b/api/tests/identity-access-management/integration/infrastructure/repositories/user.repository.test.js index d550b6eb64e..f2ebef2f7a6 100644 --- a/api/tests/identity-access-management/integration/infrastructure/repositories/user.repository.test.js +++ b/api/tests/identity-access-management/integration/infrastructure/repositories/user.repository.test.js @@ -3,6 +3,7 @@ const { each, map, times, pick } = lodash; import { DomainTransaction } from '../../../../../lib/infrastructure/DomainTransaction.js'; import { NON_OIDC_IDENTITY_PROVIDERS } from '../../../../../src/identity-access-management/domain/constants/identity-providers.js'; import * as OidcIdentityProviders from '../../../../../src/identity-access-management/domain/constants/oidc-identity-providers.js'; +import { InvalidOrAlreadyUsedEmailError } from '../../../../../src/identity-access-management/domain/errors.js'; import { User } from '../../../../../src/identity-access-management/domain/models/User.js'; import { UserDetailsForAdmin } from '../../../../../src/identity-access-management/domain/models/UserDetailsForAdmin.js'; import * as userRepository from '../../../../../src/identity-access-management/infrastructure/repositories/user.repository.js'; @@ -12,7 +13,6 @@ import { OrganizationLearnerForAdmin } from '../../../../../src/prescription/lea import { ORGANIZATION_FEATURE } from '../../../../../src/shared/domain/constants.js'; import { AlreadyExistingEntityError, - AlreadyRegisteredEmailError, AlreadyRegisteredUsernameError, UserNotFoundError, } from '../../../../../src/shared/domain/errors.js'; @@ -1804,7 +1804,7 @@ describe('Integration | Identity Access Management | Infrastructure | Repository const result = await catchErr(userRepository.checkIfEmailIsAvailable)(userInDb.email); // then - expect(result).to.be.instanceOf(AlreadyRegisteredEmailError); + expect(result).to.be.instanceOf(InvalidOrAlreadyUsedEmailError); }); it('should reject an AlreadyRegisteredEmailError when email case insensitive already exists', async function () { @@ -1818,7 +1818,7 @@ describe('Integration | Identity Access Management | Infrastructure | Repository const result = await catchErr(userRepository.checkIfEmailIsAvailable)(lowerCaseEmail); // then - expect(result).to.be.instanceOf(AlreadyRegisteredEmailError); + expect(result).to.be.instanceOf(InvalidOrAlreadyUsedEmailError); }); }); diff --git a/api/tests/identity-access-management/unit/domain/usecases/create-user.usecase.test.js b/api/tests/identity-access-management/unit/domain/usecases/create-user.usecase.test.js index f57b49c32b7..90b0c1444f7 100644 --- a/api/tests/identity-access-management/unit/domain/usecases/create-user.usecase.test.js +++ b/api/tests/identity-access-management/unit/domain/usecases/create-user.usecase.test.js @@ -1,8 +1,8 @@ import { createAccountCreationEmail } from '../../../../../src/identity-access-management/domain/emails/create-account-creation.email.js'; +import { InvalidOrAlreadyUsedEmailError } from '../../../../../src/identity-access-management/domain/errors.js'; import { User } from '../../../../../src/identity-access-management/domain/models/User.js'; import { createUser } from '../../../../../src/identity-access-management/domain/usecases/create-user.usecase.js'; import { DomainTransaction } from '../../../../../src/shared/domain/DomainTransaction.js'; -import { AlreadyRegisteredEmailError } from '../../../../../src/shared/domain/errors.js'; import { EntityValidationError } from '../../../../../src/shared/domain/errors.js'; import { urlBuilder } from '../../../../../src/shared/infrastructure/utils/url-builder.js'; import { catchErr, expect, sinon } from '../../../../test-helper.js'; @@ -140,12 +140,12 @@ describe('Unit | Identity Access Management | Domain | UseCase | create-user', f context('when user email is already used', function () { it('should reject with an error EntityValidationError on email already registered', async function () { // given - const emailExistError = new AlreadyRegisteredEmailError('email already exists'); + const emailExistError = new InvalidOrAlreadyUsedEmailError('email already exists'); const expectedValidationError = new EntityValidationError({ invalidAttributes: [ { attribute: 'email', - message: 'ALREADY_REGISTERED_EMAIL', + message: 'INVALID_OR_ALREADY_USED_EMAIL', }, ], }); @@ -231,9 +231,9 @@ describe('Unit | Identity Access Management | Domain | UseCase | create-user', f }, ], }); - const emailExistError = new AlreadyRegisteredEmailError('email already exists'); + const emailExistError = new InvalidOrAlreadyUsedEmailError('email already exists'); - it('should reject with an error EntityValidationError containing the entityValidationError and the AlreadyRegisteredEmailError', async function () { + it('should reject with an error EntityValidationError containing the entityValidationError and the InvalidOrAlreadyUsedEmailError', async function () { // given userRepository.checkIfEmailIsAvailable.rejects(emailExistError); userValidator.validate.throws(entityValidationError); diff --git a/api/translations/en.json b/api/translations/en.json index a7194451939..1bb34a527d9 100644 --- a/api/translations/en.json +++ b/api/translations/en.json @@ -295,6 +295,7 @@ "EMPTY_LAST_NAME": "Please enter a last name.", "EMPTY_USERNAME": "Please enter a username.", "FILL_USERNAME_OR_EMAIL": "Please enter an email address and/or a username.", + "INVALID_OR_ALREADY_USED_EMAIL" : "Invalid or already used e-mail address", "MAX_SIZE_EMAIL": "Your email address must not exceed 255 characters.", "MAX_SIZE_FIRST_NAME": "Your first name must not exceed 255 characters.", "MAX_SIZE_LAST_NAME": "Your last name must not exceed 255 characters.", diff --git a/api/translations/es.json b/api/translations/es.json index a408bb9af0d..48694b119ad 100644 --- a/api/translations/es.json +++ b/api/translations/es.json @@ -307,6 +307,7 @@ "EMPTY_LAST_NAME": "No se ha introducido su nombre.", "EMPTY_USERNAME": "Su nombre de usuario no se ha rellenado.", "FILL_USERNAME_OR_EMAIL": "Debe introducir una dirección de correo electrónico y/o un nombre de usuario.", + "INVALID_OR_ALREADY_USED_EMAIL" : "Invalid or already used e-mail address", "MAX_SIZE_EMAIL": "Su dirección de correo electrónico no debe superar los 255 caracteres.", "MAX_SIZE_FIRST_NAME": "Su nombre no debe superar los 255 caracteres.", "MAX_SIZE_LAST_NAME": "Su nombre no debe superar los 255 caracteres.", diff --git a/api/translations/fr.json b/api/translations/fr.json index 766beb9d76e..6eede2104be 100644 --- a/api/translations/fr.json +++ b/api/translations/fr.json @@ -309,6 +309,7 @@ "EMPTY_LAST_NAME": "Votre nom n’est pas renseignée.", "EMPTY_USERNAME": "Votre identifiant n’est pas renseigné.", "FILL_USERNAME_OR_EMAIL": "Vous devez renseigner une adresse e-mail et/ou un identifiant.", + "INVALID_OR_ALREADY_USED_EMAIL" : "Adresse e-mail invalide ou déjà utilisée", "MAX_SIZE_EMAIL": "Votre adresse e-mail ne doit pas dépasser les 255 caractères.", "MAX_SIZE_FIRST_NAME": "Votre prénom ne doit pas dépasser les 255 caractères.", "MAX_SIZE_LAST_NAME": "Votre nom ne doit pas dépasser les 255 caractères.", diff --git a/api/translations/nl.json b/api/translations/nl.json index fcd3f147501..e1104975118 100644 --- a/api/translations/nl.json +++ b/api/translations/nl.json @@ -307,6 +307,7 @@ "EMPTY_LAST_NAME": "Je naam is niet ingevuld.", "EMPTY_USERNAME": "Uw login is niet ingevuld.", "FILL_USERNAME_OR_EMAIL": "Je moet een e-mailadres en/of een gebruikersnaam invoeren.", + "INVALID_OR_ALREADY_USED_EMAIL" : "Invalid or already used e-mail address", "MAX_SIZE_EMAIL": "Je e-mailadres mag niet langer zijn dan 255 tekens.", "MAX_SIZE_FIRST_NAME": "Je voornaam mag niet langer zijn dan 255 tekens.", "MAX_SIZE_LAST_NAME": "Je naam mag niet langer zijn dan 255 tekens.", diff --git a/certif/app/components/auth/register-form.js b/certif/app/components/auth/register-form.js index 2ef75013fd7..84c9ca77568 100644 --- a/certif/app/components/auth/register-form.js +++ b/certif/app/components/auth/register-form.js @@ -113,7 +113,7 @@ export default class RegisterForm extends Component { const status = get(response, 'errors[0].status'); if (status === '422') { - this.errorMessage = this.intl.t('common.form-errors.email.already-exists'); + this.errorMessage = this.intl.t('common.form-errors.email.invalid-or-already-used-email'); } else { this.errorMessage = this.intl.t('common.form-errors.default'); } diff --git a/certif/tests/unit/components/auth/register-form-test.js b/certif/tests/unit/components/auth/register-form-test.js index 674d75fe974..8a8cb2afd75 100644 --- a/certif/tests/unit/components/auth/register-form-test.js +++ b/certif/tests/unit/components/auth/register-form-test.js @@ -134,7 +134,7 @@ module('Unit | Component | register-form', (hooks) => { await component.register(eventStub); // then - assert.strictEqual(component.errorMessage, t('common.form-errors.email.already-exists')); + assert.strictEqual(component.errorMessage, t('common.form-errors.email.invalid-or-already-used-email')); sinon.assert.calledOnce(deleteRecord); }); }); diff --git a/certif/translations/en.json b/certif/translations/en.json index e447e3376c4..304ecb963c2 100644 --- a/certif/translations/en.json +++ b/certif/translations/en.json @@ -79,8 +79,8 @@ "form-errors": { "default": "The service is temporarily unavailable. Please try again later.", "email": { - "already-exists": "This email address is already registered, please login.", - "format": "Your email address is invalid." + "format": "Your email address is invalid.", + "invalid-or-already-used-email": "Invalid or already used e-mail address" }, "fill-mandatory-fields": "Please fill in all the required fields before confirming.", "firstname": { diff --git a/certif/translations/fr.json b/certif/translations/fr.json index 6a3d565b68f..80be1d571fa 100644 --- a/certif/translations/fr.json +++ b/certif/translations/fr.json @@ -79,8 +79,8 @@ "form-errors": { "default": "Le service est momentanément indisponible. Veuillez réessayer ultérieurement.", "email": { - "already-exists": "Cette adresse e-mail est déjà enregistrée, connectez-vous.", - "format": "Le champ adresse e-mail n’est pas valide." + "format": "Le champ adresse e-mail n’est pas valide.", + "invalid-or-already-used-email": "Adresse e-mail invalide ou déjà utilisée" }, "fill-mandatory-fields": "Veuillez remplir tous les champs obligatoires avant de valider.", "firstname": { diff --git a/mon-pix/app/components/account-recovery/backup-email-confirmation-form.hbs b/mon-pix/app/components/account-recovery/backup-email-confirmation-form.hbs index 7d1a0bef589..ad5dd4b4fad 100644 --- a/mon-pix/app/components/account-recovery/backup-email-confirmation-form.hbs +++ b/mon-pix/app/components/account-recovery/backup-email-confirmation-form.hbs @@ -43,7 +43,9 @@ class="account-recovery__content--not-found-error" id="backup-email-confirmation-already-use-error-message" > - {{t "pages.account-recovery.find-sco-record.backup-email-confirmation.form.error.new-email-already-exist"}} + {{t + "pages.account-recovery.find-sco-record.backup-email-confirmation.form.error.invalid-or-already-used-email" + }} {{/if}} diff --git a/mon-pix/app/components/user-account/email-with-validation-form.js b/mon-pix/app/components/user-account/email-with-validation-form.js index ca9f355898d..385ade91bd1 100644 --- a/mon-pix/app/components/user-account/email-with-validation-form.js +++ b/mon-pix/app/components/user-account/email-with-validation-form.js @@ -11,6 +11,8 @@ const ERROR_INPUT_MESSAGE_MAP = { invalidEmail: 'pages.user-account.account-update-email-with-validation.fields.errors.invalid-email', emptyPassword: 'pages.user-account.account-update-email-with-validation.fields.errors.empty-password', emailAlreadyExist: 'pages.user-account.account-update-email-with-validation.fields.errors.new-email-already-exist', + invalidOrAlreadyUsedEmail: + 'pages.user-account.account-update-email-with-validation.fields.errors.invalid-or-already-used-email', invalidPassword: 'pages.user-account.account-update-email-with-validation.fields.errors.invalid-password', unknownError: 'pages.user-account.account-update-email.fields.errors.unknown-error', }; @@ -89,8 +91,8 @@ export default class EmailWithValidationForm extends Component { } else if (status === '400') { const code = get(response, 'errors[0].code'); this.errorMessage = this.intl.t(ERROR_INPUT_MESSAGE_MAP['invalidPassword']); - if (code === 'ACCOUNT_WITH_EMAIL_ALREADY_EXISTS') { - this.errorMessage = this.intl.t(ERROR_INPUT_MESSAGE_MAP['emailAlreadyExist']); + if (code === 'INVALID_OR_ALREADY_USED_EMAIL') { + this.errorMessage = this.intl.t(ERROR_INPUT_MESSAGE_MAP['invalidOrAlreadyUsedEmail']); } } else { this.errorMessage = this.intl.t(ERROR_INPUT_MESSAGE_MAP['unknownError']); diff --git a/mon-pix/app/controllers/account-recovery/find-sco-record.js b/mon-pix/app/controllers/account-recovery/find-sco-record.js index ec7bc2664d0..38ba24fbb7a 100644 --- a/mon-pix/app/controllers/account-recovery/find-sco-record.js +++ b/mon-pix/app/controllers/account-recovery/find-sco-record.js @@ -109,7 +109,7 @@ export default class FindScoRecordController extends Controller { const hasInternalErrorOrConflictOrAlreadyLeftSco = status === 403 || status === 409 || status >= 500 || isApiUnreachable; const isEmailAlreadyRegistered = - this.showBackupEmailConfirmationForm && status === 400 && code === 'ACCOUNT_WITH_EMAIL_ALREADY_EXISTS'; + this.showBackupEmailConfirmationForm && status === 400 && code === 'INVALID_OR_ALREADY_USED_EMAIL'; if (!hasInternalErrorOrConflictOrAlreadyLeftSco || isEmailAlreadyRegistered) { this._showErrorOnComponent(isEmailAlreadyRegistered); diff --git a/mon-pix/mirage/routes/account-recovery/index.js b/mon-pix/mirage/routes/account-recovery/index.js index f6c9d2a4b58..5316a8dc156 100644 --- a/mon-pix/mirage/routes/account-recovery/index.js +++ b/mon-pix/mirage/routes/account-recovery/index.js @@ -13,7 +13,7 @@ export default function index(config) { 400, {}, { - errors: [{ status: '400', code: 'ACCOUNT_WITH_EMAIL_ALREADY_EXISTS' }], + errors: [{ status: '400', code: 'INVALID_OR_ALREADY_USED_EMAIL' }], }, ); } diff --git a/mon-pix/tests/acceptance/account-recovery/find-sco-record-test.js b/mon-pix/tests/acceptance/account-recovery/find-sco-record-test.js index ba40b16f0f5..c9e6fbf5303 100644 --- a/mon-pix/tests/acceptance/account-recovery/find-sco-record-test.js +++ b/mon-pix/tests/acceptance/account-recovery/find-sco-record-test.js @@ -244,7 +244,9 @@ module('Acceptance | account-recovery | FindScoRecordRoute', function (hooks) { // then assert.ok( screen.getByText( - t('pages.account-recovery.find-sco-record.backup-email-confirmation.form.error.new-email-already-exist'), + t( + 'pages.account-recovery.find-sco-record.backup-email-confirmation.form.error.invalid-or-already-used-email', + ), ), ); }); diff --git a/mon-pix/tests/integration/components/user-account/email-with-validation-form-test.js b/mon-pix/tests/integration/components/user-account/email-with-validation-form-test.js index edf586a2e67..45329e508c7 100644 --- a/mon-pix/tests/integration/components/user-account/email-with-validation-form-test.js +++ b/mon-pix/tests/integration/components/user-account/email-with-validation-form-test.js @@ -95,7 +95,7 @@ module('Integration | Component | user-account | email-with-validation-form', fu const emailAlreadyExist = 'email@example.net'; const password = 'password'; store.createRecord = () => ({ - sendNewEmail: sinon.stub().throws({ errors: [{ status: '400', code: 'ACCOUNT_WITH_EMAIL_ALREADY_EXISTS' }] }), + sendNewEmail: sinon.stub().throws({ errors: [{ status: '400', code: 'INVALID_OR_ALREADY_USED_EMAIL' }] }), }); const screen = await render( @@ -108,7 +108,7 @@ module('Integration | Component | user-account | email-with-validation-form', fu // then assert.ok( screen.getByText( - t('pages.user-account.account-update-email-with-validation.fields.errors.new-email-already-exist'), + t('pages.user-account.account-update-email-with-validation.fields.errors.invalid-or-already-used-email'), ), ); }); diff --git a/mon-pix/translations/en.json b/mon-pix/translations/en.json index 05552c1824f..a5303bacdf7 100644 --- a/mon-pix/translations/en.json +++ b/mon-pix/translations/en.json @@ -344,6 +344,7 @@ "new-email": ",if not, enter a new one." }, "empty-email": "The e-mail address field is mandatory.", + "invalid-or-already-used-email" : "Invalid or already used e-mail address", "new-backup-email": "Please enter a valid e-mail address to recover your account", "new-email-already-exist": "This e-mail address is already in use", "wrong-email-format": "Your e-mail address is invalid." @@ -2074,6 +2075,7 @@ "errors": { "empty-password": "Your password can't be empty.", "invalid-email": "Your email address is invalid.", + "invalid-or-already-used-email" : "Invalid or already used e-mail address", "invalid-password": "There was an error in the password entered.", "new-email-already-exist": "This email address is already in use." }, diff --git a/mon-pix/translations/es.json b/mon-pix/translations/es.json index 55db20173d7..05950738c40 100644 --- a/mon-pix/translations/es.json +++ b/mon-pix/translations/es.json @@ -361,6 +361,7 @@ "new-email": ", de lo contrario, introduce una nueva." }, "empty-email": "El campo de dirección de correo electrónico es obligatorio.", + "invalid-or-already-used-email" : "Invalid or already used e-mail address", "new-backup-email": "Introduce una dirección de correo electrónico válida para restablecer tu cuenta", "new-email-already-exist": "Esta dirección de correo electrónico ya se está utilizando", "wrong-email-format": "Tu dirección de correo electrónico no es válida." @@ -2069,6 +2070,7 @@ "errors": { "empty-password": "Tu contraseña no puede estar vacía.", "invalid-email": "Tu dirección de correo electrónico no es válida.", + "invalid-or-already-used-email" : "Invalid or already used e-mail address", "invalid-password": "La contraseña que has introducido no es válida.", "new-email-already-exist": "Esta dirección de correo electrónico ya se está utilizando." }, @@ -2205,4 +2207,4 @@ "title": "Mis tutoriales" } } -} \ No newline at end of file +} diff --git a/mon-pix/translations/fr.json b/mon-pix/translations/fr.json index 1422fb5c3ba..551e8bcac25 100644 --- a/mon-pix/translations/fr.json +++ b/mon-pix/translations/fr.json @@ -344,6 +344,7 @@ "new-email": ", sinon saisissez une nouvelle." }, "empty-email": "Le champ adresse e-mail est obligatoire.", + "invalid-or-already-used-email" : "Adresse e-mail invalide ou déjà utilisée", "new-backup-email": "Veuillez saisir un e-mail valide pour récupérer votre compte", "new-email-already-exist": "Cette adresse e-mail est déjà utilisée", "wrong-email-format": "Votre adresse e-mail n’est pas valide." @@ -2075,6 +2076,7 @@ "errors": { "empty-password": "Votre mot de passe ne peut pas être vide.", "invalid-email": "Votre adresse e-mail n’est pas valide.", + "invalid-or-already-used-email" : "Adresse e-mail invalide ou déjà utilisée", "invalid-password": "Le mot de passe que vous avez saisi est invalide.", "new-email-already-exist": "Cette adresse e-mail est déjà utilisée." }, diff --git a/mon-pix/translations/nl.json b/mon-pix/translations/nl.json index bfbae10469d..02571de2364 100644 --- a/mon-pix/translations/nl.json +++ b/mon-pix/translations/nl.json @@ -361,6 +361,7 @@ "new-email": "Zo niet, voer dan een nieuwe in." }, "empty-email": "Het e-mailadresveld is verplicht.", + "invalid-or-already-used-email" : "Invalid or already used e-mail address", "new-backup-email": "Voer een geldig e-mailadres in om uw account te herstellen", "new-email-already-exist": "Dit e-mailadres is al in gebruik", "wrong-email-format": "Uw e-mailadres is ongeldig." @@ -2069,6 +2070,7 @@ "errors": { "empty-password": "Je wachtwoord mag niet leeg zijn.", "invalid-email": "Uw e-mailadres is ongeldig.", + "invalid-or-already-used-email" : "Invalid or already used e-mail address", "invalid-password": "Het ingevoerde wachtwoord is ongeldig.", "new-email-already-exist": "Dit e-mailadres is al in gebruik." }, @@ -2205,4 +2207,4 @@ "title": "Mijn tutorials" } } -} \ No newline at end of file +}