Skip to content

Commit

Permalink
refactor(api): handle account recovery case
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelleBonnemay committed Nov 15, 2024
1 parent 815eeb0 commit 2ca29e1
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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('Cette adresse e-mail est invalide ou déjà utilisée.');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}}
</PixMessage>
{{/if}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions mon-pix/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
1 change: 1 addition & 0 deletions mon-pix/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
1 change: 1 addition & 0 deletions mon-pix/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
1 change: 1 addition & 0 deletions mon-pix/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 2ca29e1

Please sign in to comment.