From b88cfd9eaba6a67f4c9d8c1f200e5945938d9e60 Mon Sep 17 00:00:00 2001 From: Mill Date: Wed, 27 Jul 2022 16:58:01 -0700 Subject: [PATCH] fix(fxa-auth-server) change user-facing 'verify' references to 'confirm' in emails fix(fxa-settings): swap in 'confirm' for 'verify' fix(fxa-auth-server): update 'verify' to 'confirm' fix(fxa-support-panel): update 'verify' to 'confirm' in copy fix(fxa-content-server): update 'verify' to 'confirm' fix(fxa-settings) append string version to translation id for fluent fix(fxa-settings): fix failing test (also failing on main) fix(fxa-auth-server): update tests Update packages/fxa-auth-server/lib/senders/emails/templates/verifyPrimary/en.ftl Co-authored-by: Bryan Olsson chore(fxa-auth-server): add tests and errors to string id util, update impacted tests --- .../functional-tests/lib/fixtures/standard.ts | 2 +- .../tests/settings/misc.spec.ts | 4 +- .../AccountSearch/Account/index.test.tsx | 6 +- .../AccountSearch/Account/index.tsx | 22 ++--- packages/fxa-auth-server/lib/error.js | 14 ++-- packages/fxa-auth-server/lib/l10n/auth.ftl | 2 +- .../senders/emails/templates/_versions.json | 18 ++-- .../emails/templates/postVerify/en.ftl | 4 +- .../emails/templates/postVerify/includes.json | 4 +- .../emails/templates/postVerify/index.mjml | 2 +- .../emails/templates/postVerify/index.txt | 2 +- .../templates/postVerifySecondary/en.ftl | 2 +- .../templates/postVerifySecondary/index.mjml | 4 +- .../templates/postVerifySecondary/index.txt | 2 +- .../subscriptionAccountReminderFirst/en.ftl | 4 +- .../index.mjml | 8 +- .../index.txt | 4 +- .../subscriptionAccountReminderSecond/en.ftl | 4 +- .../index.mjml | 8 +- .../index.txt | 4 +- .../verificationReminderSecond/en.ftl | 2 +- .../verificationReminderSecond/index.mjml | 2 +- .../verificationReminderSecond/index.txt | 2 +- .../emails/templates/verifyLoginCode/en.ftl | 2 +- .../templates/verifyLoginCode/index.mjml | 4 +- .../templates/verifyLoginCode/index.txt | 2 +- .../emails/templates/verifyPrimary/en.ftl | 8 +- .../templates/verifyPrimary/includes.json | 4 +- .../emails/templates/verifyPrimary/index.mjml | 10 +-- .../emails/templates/verifyPrimary/index.txt | 6 +- .../templates/verifySecondaryCode/en.ftl | 8 +- .../verifySecondaryCode/includes.json | 4 +- .../templates/verifySecondaryCode/index.mjml | 6 +- .../templates/verifySecondaryCode/index.txt | 6 +- .../emails/templates/verifyShortCode/en.ftl | 4 +- .../templates/verifyShortCode/includes.json | 4 +- .../templates/verifyShortCode/index.mjml | 2 +- .../templates/verifyShortCode/index.txt | 2 +- .../lib/verification-reminders.js | 2 +- .../scripts/e2e-email/localeQuirks.js | 6 +- .../scripts/e2e-email/validate-email.js | 4 +- .../test/local/routes/account.js | 2 +- .../test/local/routes/emails.js | 8 +- .../test/local/senders/emails.ts | 40 ++++----- .../test/local/senders/renderer.ts | 14 +--- .../test/remote/account_create_tests.js | 2 +- .../account_signin_verification_tests.js | 6 +- .../test/remote/password_forgot_tests.js | 6 +- .../remote/recovery_email_verify_tests.js | 2 +- .../templates/complete_sign_up.mustache | 10 +-- .../app/scripts/templates/confirm.mustache | 2 +- .../templates/connect_another_device.mustache | 2 +- .../confirm_secondary_email.mustache | 8 +- .../templates/security_events.mustache | 2 +- .../templates/sign_in_recovery_code.mustache | 2 +- .../templates/sign_in_totp_code.mustache | 2 +- .../app/scripts/views/behaviors/settings.js | 2 +- .../app/scripts/views/post_verify/verified.js | 2 +- .../app/scripts/views/ready.js | 6 +- .../functional/settings/secondary_email.js | 2 +- .../components/ModalVerifySession/en-US.ftl | 10 +-- .../components/ModalVerifySession/index.tsx | 20 ++--- .../components/PageChangePassword/index.tsx | 6 +- .../components/PageDeleteAccount/index.tsx | 4 +- .../PageRecoveryKeyAdd/index.test.tsx | 7 ++ .../components/PageRecoveryKeyAdd/index.tsx | 5 +- .../PageSecondaryEmailAdd/index.tsx | 4 +- .../PageSecondaryEmailVerify/en-US.ftl | 10 +-- .../PageSecondaryEmailVerify/index.tsx | 20 ++--- .../PageTwoStepAuthentication/en-US.ftl | 2 +- .../PageTwoStepAuthentication/index.tsx | 8 +- .../components/UnitRowRecoveryKey/en-US.ftl | 2 +- .../components/UnitRowRecoveryKey/index.tsx | 4 +- .../UnitRowSecondaryEmail/en-US.ftl | 10 +-- .../UnitRowSecondaryEmail/index.tsx | 22 ++--- .../components/UnitRowTwoStepAuth/en-US.ftl | 2 +- .../components/UnitRowTwoStepAuth/index.tsx | 4 +- .../src/lib/auth-errors/auth-errors.test.ts | 84 +++++++++++++++++++ .../src/lib/auth-errors/auth-errors.ts | 79 +++++++++++++---- .../src/lib/auth-errors/en-US.ftl | 6 +- packages/fxa-shared/guards/AdminPanelGuard.ts | 2 +- packages/fxa-support-panel/views/index.hbs | 2 +- 82 files changed, 387 insertions(+), 256 deletions(-) create mode 100644 packages/fxa-settings/src/lib/auth-errors/auth-errors.test.ts diff --git a/packages/functional-tests/lib/fixtures/standard.ts b/packages/functional-tests/lib/fixtures/standard.ts index 928af367928..c892fd5e2b4 100644 --- a/packages/functional-tests/lib/fixtures/standard.ts +++ b/packages/functional-tests/lib/fixtures/standard.ts @@ -44,7 +44,7 @@ export const test = base.extend({ try { await target.auth.accountDestroy(credentials.email, credentials.password); } catch (error: any) { - if (error.message === 'Unverified session') { + if (error.message === 'Unconfirmed session') { // If totp was enabled we'll need a verified session to destroy the account if (credentials.secret) { // we don't know if the original session still exists diff --git a/packages/functional-tests/tests/settings/misc.spec.ts b/packages/functional-tests/tests/settings/misc.spec.ts index 8b2f76a0d24..63c23741712 100644 --- a/packages/functional-tests/tests/settings/misc.spec.ts +++ b/packages/functional-tests/tests/settings/misc.spec.ts @@ -26,7 +26,7 @@ test.describe('severity-1 #smoke', () => { credentials, pages: { settings, deleteAccount, page }, }) => { - test.slow(); + test.slow(); await settings.goto(); await settings.clickDeleteAccount(); await deleteAccount.checkAllBoxes(); @@ -76,7 +76,7 @@ test.describe('severity-2 #smoke', () => { await secondaryEmail.submit(); // skip verification await settings.goto(); - expect(await settings.secondaryEmail.statusText()).toMatch('UNVERIFIED'); + expect(await settings.secondaryEmail.statusText()).toMatch('UNCONFIRMED'); await settings.secondaryEmail.clickDelete(); await settings.waitForAlertBar(); expect(await settings.alertBarText()).toMatch('successfully deleted'); diff --git a/packages/fxa-admin-panel/src/components/AccountSearch/Account/index.test.tsx b/packages/fxa-admin-panel/src/components/AccountSearch/Account/index.test.tsx index b60086aff9c..4f267242fa6 100644 --- a/packages/fxa-admin-panel/src/components/AccountSearch/Account/index.test.tsx +++ b/packages/fxa-admin-panel/src/components/AccountSearch/Account/index.test.tsx @@ -200,7 +200,7 @@ it('displays the account', async () => { ); expect(getByTestId('account-section')).toBeInTheDocument(); - expect(getByTestId('account-verified-status')).toHaveTextContent('verified'); + expect(getByTestId('account-verified-status')).toHaveTextContent('confirmed'); expect(getByTestId('email-label')).toHaveTextContent( accountResponse.emails![0].email ); @@ -250,7 +250,7 @@ it('displays the unverified account', async () => { ); expect(getByTestId('account-verified-status')).toHaveTextContent( - 'not verified' + 'not confirmed' ); }); @@ -344,5 +344,5 @@ it('displays secondary emails', async () => { expect(getByTestId('secondary-email')).toHaveTextContent( 'ohdeceiver@gmail.com' ); - expect(getByTestId('secondary-verified')).toHaveTextContent('not verified'); + expect(getByTestId('secondary-verified')).toHaveTextContent('not confirmed'); }); diff --git a/packages/fxa-admin-panel/src/components/AccountSearch/Account/index.tsx b/packages/fxa-admin-panel/src/components/AccountSearch/Account/index.tsx index c6903f55d33..bf1bb2e0815 100644 --- a/packages/fxa-admin-panel/src/components/AccountSearch/Account/index.tsx +++ b/packages/fxa-admin-panel/src/components/AccountSearch/Account/index.tsx @@ -171,11 +171,11 @@ export const DangerZone = ({ }: DangerZoneProps) => { const [unverify, { loading: unverifyLoading }] = useMutation(UNVERIFY_EMAIL, { onCompleted: () => { - window.alert("The user's email has been unverified."); + window.alert("The user's email has been unconfirmed."); onCleared(); }, onError: () => { - window.alert('Error in unverifying email'); + window.alert('Error in unconfirming email'); }, }); @@ -248,17 +248,17 @@ export const DangerZone = ({

-

Email Verification

+

Email Confirmation

- Reset email verification. User needs to re-verify on next login. + Reset email confirmation. User needs to re-confirm on next login.


{unverifyMessage}

@@ -360,7 +360,7 @@ export const Account = ({ : 'account-disabled-unverified' } > - {primaryEmail.isVerified ? 'verified' : 'not verified'} + {primaryEmail.isVerified ? 'confirmed' : 'not confirmed'} } /> @@ -431,7 +431,7 @@ export const Account = ({ : 'account-disabled-unverified' }`} > - {secondaryEmail.isVerified ? 'verified' : 'not verified'} + {secondaryEmail.isVerified ? 'confirmed' : 'not confirmed'} ))} @@ -766,7 +766,7 @@ const TotpEnabled = ({ verified, createdAt, enabled }: TotpType) => { TOTP Created At: {totpDate}
  • - TOTP Verified:{' '} + TOTP Confirmed:{' '} { : 'account-disabled-unverified' }`} > - {verified ? 'verified' : 'not verified'} + {verified ? 'confirmed' : 'not confirmed'}
  • @@ -812,7 +812,7 @@ const RecoveryKeys = ({ verifiedAt, createdAt, enabled }: RecoveryKeysType) => {
  • - Recovery Key Verified At:{' '} + Recovery Key Confirmed At:{' '} { : 'account-disabled-unverified' }`} > - {verifiedAt ? recoveryKeyVerifiedDate : 'not verified'} + {verifiedAt ? recoveryKeyVerifiedDate : 'not confirmed'}
  • diff --git a/packages/fxa-auth-server/lib/error.js b/packages/fxa-auth-server/lib/error.js index 2241a0f337b..492e93ef225 100644 --- a/packages/fxa-auth-server/lib/error.js +++ b/packages/fxa-auth-server/lib/error.js @@ -386,7 +386,7 @@ AppError.unverifiedAccount = function () { code: 400, error: 'Bad Request', errno: ERRNO.ACCOUNT_UNVERIFIED, - message: 'Unverified account', + message: 'Unconfirmed account', }); }; @@ -396,7 +396,7 @@ AppError.invalidVerificationCode = function (details) { code: 400, error: 'Bad Request', errno: ERRNO.INVALID_VERIFICATION_CODE, - message: 'Invalid verification code', + message: 'Invalid confirmation code', }, details ); @@ -844,7 +844,7 @@ AppError.unverifiedSession = function () { code: 400, error: 'Bad Request', errno: ERRNO.SESSION_UNVERIFIED, - message: 'Unverified session', + message: 'Unconfirmed session', }); }; @@ -955,7 +955,7 @@ AppError.cannotChangeEmailToUnverifiedEmail = function () { code: 400, error: 'Bad Request', errno: ERRNO.CHANGE_EMAIL_TO_UNVERIFIED_EMAIL, - message: 'Can not change primary email to an unverified email', + message: 'Can not change primary email to an unconfirmed email', }); }; @@ -1011,7 +1011,7 @@ AppError.invalidTokenVerficationCode = function (details) { code: 400, error: 'Bad Request', errno: ERRNO.INVALID_TOKEN_VERIFICATION_CODE, - message: 'Invalid token verification code', + message: 'Invalid token confirmation code', }, details ); @@ -1023,7 +1023,7 @@ AppError.expiredTokenVerficationCode = function (details) { code: 400, error: 'Bad Request', errno: ERRNO.EXPIRED_TOKEN_VERIFICATION_CODE, - message: 'Expired token verification code', + message: 'Expired token confirmation code', }, details ); @@ -1469,7 +1469,7 @@ AppError.invalidOrExpiredOtpCode = () => { code: 400, error: 'Bad Request', errno: ERRNO.INVALID_EXPIRED_OTP_CODE, - message: 'Invalid or expired verification code', + message: 'Invalid or expired confirmation code', }); }; diff --git a/packages/fxa-auth-server/lib/l10n/auth.ftl b/packages/fxa-auth-server/lib/l10n/auth.ftl index 9129b1bd504..c3611713d85 100644 --- a/packages/fxa-auth-server/lib/l10n/auth.ftl +++ b/packages/fxa-auth-server/lib/l10n/auth.ftl @@ -25,4 +25,4 @@ ## Non-email strings session-verify-send-push-title = Logging in to { -product-firefox-accounts }? -session-verify-send-push-body = Click here to verify it’s you +session-verify-send-push-body-2 = Click here to confirm it’s you diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/_versions.json b/packages/fxa-auth-server/lib/senders/emails/templates/_versions.json index 97c1a5fd56c..4834f59c91e 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/_versions.json +++ b/packages/fxa-auth-server/lib/senders/emails/templates/_versions.json @@ -26,18 +26,18 @@ "postAddLinkedAccount": 1, "postChangePrimary": 5, "postRemoveSecondary": 5, - "postVerify": 6, - "postVerifySecondary": 5, + "postVerify": 7, + "postVerifySecondary": 6, "recovery": 5, "unblockCode": 6, "verificationReminderFirst": 9, - "verificationReminderSecond": 9, + "verificationReminderSecond": 10, "verify": 6, - "verifyPrimary": 7, + "verifyPrimary": 8, "verifyLogin": 5, - "verifyLoginCode": 6, - "verifyShortCode": 3, - "verifySecondaryCode": 2, + "verifyLoginCode": 7, + "verifyShortCode": 4, + "verifySecondaryCode": 3, "postAddTwoStepAuthentication": 8, "postRemoveTwoStepAuthentication": 8, "postConsumeRecoveryCode": 5, @@ -47,6 +47,6 @@ "postRemoveAccountRecovery": 6, "cadReminderFirst": 3, "cadReminderSecond": 3, - "subscriptionAccountReminderFirst": 2, - "subscriptionAccountReminderSecond": 2 + "subscriptionAccountReminderFirst": 3, + "subscriptionAccountReminderSecond": 3 } diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/postVerify/en.ftl b/packages/fxa-auth-server/lib/senders/emails/templates/postVerify/en.ftl index c3b8c220bec..a16ae72280b 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/postVerify/en.ftl +++ b/packages/fxa-auth-server/lib/senders/emails/templates/postVerify/en.ftl @@ -1,7 +1,7 @@ -postVerify-sub-title = { -product-firefox-account } verified. You’re almost there. +postVerify-sub-title-2 = { -product-firefox-account } confirmed. You’re almost there. postVerify-title = Next sync between your devices! postVerify-description = Sync privately keeps your bookmarks, passwords and other { -brand-firefox } data the same across all your devices. -postVerify-subject = Account verified. Next, sync another device to finish setup +postVerify-subject-2 = Account confirmed. Next, sync another device to finish setup postVerify-setup = Set up next device postVerify-action = Set up next device # Variables: diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/postVerify/includes.json b/packages/fxa-auth-server/lib/senders/emails/templates/postVerify/includes.json index d29877a756b..ee0c47f9b92 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/postVerify/includes.json +++ b/packages/fxa-auth-server/lib/senders/emails/templates/postVerify/includes.json @@ -1,7 +1,7 @@ { "subject": { - "id": "postVerify-subject", - "message": "Account verified. Next, sync another device to finish setup" + "id": "postVerify-subject-2", + "message": "Account confirmed. Next, sync another device to finish setup" }, "action": { "id": "postVerify-action", diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/postVerify/index.mjml b/packages/fxa-auth-server/lib/senders/emails/templates/postVerify/index.mjml index c7076a293d9..0a403a04afb 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/postVerify/index.mjml +++ b/packages/fxa-auth-server/lib/senders/emails/templates/postVerify/index.mjml @@ -5,7 +5,7 @@ - Firefox account verified. You’re almost there. + Firefox account confirmed. You’re almost there. Next sync between your devices! diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/postVerify/index.txt b/packages/fxa-auth-server/lib/senders/emails/templates/postVerify/index.txt index e4453ac43c2..73a9eaba9b9 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/postVerify/index.txt +++ b/packages/fxa-auth-server/lib/senders/emails/templates/postVerify/index.txt @@ -1,4 +1,4 @@ -postVerify-sub-title = "Firefox account verified. You’re almost there." +postVerify-sub-title-2 = "Firefox account confirmed. You’re almost there." postVerify-title = "Next sync between your devices!" diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/postVerifySecondary/en.ftl b/packages/fxa-auth-server/lib/senders/emails/templates/postVerifySecondary/en.ftl index 3720f91ac08..47a51f0a98f 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/postVerifySecondary/en.ftl +++ b/packages/fxa-auth-server/lib/senders/emails/templates/postVerifySecondary/en.ftl @@ -2,5 +2,5 @@ postVerifySecondary-subject = Secondary email added postVerifySecondary-title = Secondary email added # Variables: # $secondaryEmail (String) - A user's secondary email address -postVerifySecondary-content = You have successfully verified { $secondaryEmail } as a secondary email for your { -product-firefox-account }. Security notifications and sign-in confirmations will now be delivered to both email addresses. +postVerifySecondary-content-2 = You have successfully confirmed { $secondaryEmail } as a secondary email for your { -product-firefox-account }. Security notifications and sign-in confirmations will now be delivered to both email addresses. postVerifySecondary-action = Manage account diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/postVerifySecondary/index.mjml b/packages/fxa-auth-server/lib/senders/emails/templates/postVerifySecondary/index.mjml index b59f5b310de..566dcd4b5e7 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/postVerifySecondary/index.mjml +++ b/packages/fxa-auth-server/lib/senders/emails/templates/postVerifySecondary/index.mjml @@ -16,9 +16,9 @@ - You have successfully verified <%- secondaryEmail %> as a secondary + You have successfully confirmed <%- secondaryEmail %> as a secondary email for your Firefox account. Security notifications and sign-in confirmations will now be delivered to both email addresses. diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/postVerifySecondary/index.txt b/packages/fxa-auth-server/lib/senders/emails/templates/postVerifySecondary/index.txt index 2093ac882ac..23506e6fee0 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/postVerifySecondary/index.txt +++ b/packages/fxa-auth-server/lib/senders/emails/templates/postVerifySecondary/index.txt @@ -1,6 +1,6 @@ postVerifySecondary-title = "Secondary email added" -postVerifySecondary-content = "You have successfully verified <%- secondaryEmail %> as a secondary email for your Firefox account. Security notifications and sign-in confirmations will now be delivered to both email addresses." +postVerifySecondary-content-2 = "You have successfully confirmed <%- secondaryEmail %> as a secondary email for your Firefox account. Security notifications and sign-in confirmations will now be delivered to both email addresses." <%- include('/partials/manageAccount/index.txt') %> diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderFirst/en.ftl b/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderFirst/en.ftl index 0a7efef4bfb..7202c3f09f2 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderFirst/en.ftl +++ b/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderFirst/en.ftl @@ -1,6 +1,6 @@ subscriptionAccountReminderFirst-subject = Reminder: Finish setting up your account subscriptionAccountReminderFirst-title = You can’t access your subscription yet -subscriptionAccountReminderFirst-content-info = A few days ago you created a { -product-firefox-account } but never verified it. We hope you’ll finish setting up your account, so you can use your new subscription. -subscriptionAccountReminderFirst-content-select = Select “Create Password” to set up a new password and finish verifying your account. +subscriptionAccountReminderFirst-content-info-2 = A few days ago you created a { -product-firefox-account } but never confirmed it. We hope you’ll finish setting up your account, so you can use your new subscription. +subscriptionAccountReminderFirst-content-select-2 = Select “Create Password” to set up a new password and finish confirming your account. subscriptionAccountReminderFirst-action = Create Password subscriptionAccountReminderFirst-action-plaintext = { subscriptionAccountReminderFirst-action }: diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderFirst/index.mjml b/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderFirst/index.mjml index ffda873b40f..67b18b773b4 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderFirst/index.mjml +++ b/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderFirst/index.mjml @@ -9,14 +9,14 @@ - - A few days ago you created a Firefox account but never verified it. We hope you’ll finish setting up your account, so you can use your new subscription. + + A few days ago you created a Firefox account but never confirmed it. We hope you’ll finish setting up your account, so you can use your new subscription. - - Select “Create Password” to set up a new password and finish verifying your account. + + Select “Create Password” to set up a new password and finish confirming your account. diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderFirst/index.txt b/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderFirst/index.txt index c0cf50fe8c3..d04e665178a 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderFirst/index.txt +++ b/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderFirst/index.txt @@ -2,9 +2,9 @@ subscriptionAccountReminderFirst-subject = "Reminder: Finish setting up your acc subscriptionAccountReminderFirst-title = "You can’t access your subscription yet" -subscriptionAccountReminderFirst-content-info = "A few days ago you created a Firefox account but never verified it. We hope you’ll finish setting up your account, so you can use your new subscription." +subscriptionAccountReminderFirst-content-info-2 = "A few days ago you created a Firefox account but never confirmed it. We hope you’ll finish setting up your account, so you can use your new subscription." -subscriptionAccountReminderFirst-content-select = "Select “Create Password” to set up a new password and finish verifying your account." +subscriptionAccountReminderFirst-content-select-2 = "Select “Create Password” to set up a new password and finish confirming your account." subscriptionAccountReminderFirst-action-plaintext = "Create Password:" <%- link %> diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderSecond/en.ftl b/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderSecond/en.ftl index c7c86adde80..9a18c8fdd91 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderSecond/en.ftl +++ b/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderSecond/en.ftl @@ -1,6 +1,6 @@ subscriptionAccountReminderSecond-subject = Final reminder: Setup your account subscriptionAccountReminderSecond-title = Welcome to { -brand-firefox }! -subscriptionAccountReminderSecond-content-info = A few days ago you created a { -product-firefox-account } but never verified it. We hope you’ll finish setting up your account, so you can use your new subscription. -subscriptionAccountReminderSecond-content-select = Select “Create Password” to set up a new password and finish verifying your account. +subscriptionAccountReminderSecond-content-info-2 = A few days ago you created a { -product-firefox-account } but never confirmed it. We hope you’ll finish setting up your account, so you can use your new subscription. +subscriptionAccountReminderSecond-content-select-2 = Select “Create Password” to set up a new password and finish confirming your account. subscriptionAccountReminderSecond-action = Create Password subscriptionAccountReminderSecond-action-plaintext = { subscriptionAccountReminderSecond-action }: diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderSecond/index.mjml b/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderSecond/index.mjml index 11fdb9eab7a..981b2af4164 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderSecond/index.mjml +++ b/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderSecond/index.mjml @@ -9,14 +9,14 @@ - - A few days ago you created a Firefox account but never verified it. We hope you’ll finish setting up your account, so you can use your new subscription. + + A few days ago you created a Firefox account but never confirmed it. We hope you’ll finish setting up your account, so you can use your new subscription. - - Select “Create Password” to set up a new password and finish verifying your account. + + Select “Create Password” to set up a new password and finish confirming your account. diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderSecond/index.txt b/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderSecond/index.txt index 727e174a10e..9033d22eaa1 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderSecond/index.txt +++ b/packages/fxa-auth-server/lib/senders/emails/templates/subscriptionAccountReminderSecond/index.txt @@ -2,9 +2,9 @@ subscriptionAccountReminderSecond-subject = "Final reminder: Setup your account" subscriptionAccountReminderSecond-title = "Welcome to Firefox!" -subscriptionAccountReminderSecond-content-info = "A few days ago you created a Firefox account but never verified it. We hope you’ll finish setting up your account, so you can use your new subscription." +subscriptionAccountReminderSecond-content-info-2 = "A few days ago you created a Firefox account but never confirmed it. We hope you’ll finish setting up your account, so you can use your new subscription." -subscriptionAccountReminderSecond-content-select = "Select “Create Password” to set up a new password and finish verifying your account." +subscriptionAccountReminderSecond-content-select-2 = "Select “Create Password” to set up a new password and finish confirming your account." subscriptionAccountReminderSecond-action-plaintext = "Create Password:" <%- link %> diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/verificationReminderSecond/en.ftl b/packages/fxa-auth-server/lib/senders/emails/templates/verificationReminderSecond/en.ftl index 36f24a50a12..705a02b986d 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/verificationReminderSecond/en.ftl +++ b/packages/fxa-auth-server/lib/senders/emails/templates/verificationReminderSecond/en.ftl @@ -1,5 +1,5 @@ verificationReminderSecond-subject = Final reminder: Activate your account verificationReminderSecond-title = Still there? -verificationReminderSecond-description = Almost a week ago you created a { -product-firefox-account } but never verified it. We’re worried about you. +verificationReminderSecond-description-2 = Almost a week ago you created a { -product-firefox-account } but never confirmed it. We’re worried about you. verificationReminderSecond-sub-description = Confirm this email address to activate your account and let us know you’re okay. verificationReminderSecond-action = Confirm email diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/verificationReminderSecond/index.mjml b/packages/fxa-auth-server/lib/senders/emails/templates/verificationReminderSecond/index.mjml index 93d23a0d276..cfbe47647c0 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/verificationReminderSecond/index.mjml +++ b/packages/fxa-auth-server/lib/senders/emails/templates/verificationReminderSecond/index.mjml @@ -13,7 +13,7 @@ - Almost a week ago you created a Firefox account but never verified it. We’re worried about you. + Almost a week ago you created a Firefox account but never confirmed it. We’re worried about you. Confirm this email address to activate your account and let us know you’re okay. diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/verificationReminderSecond/index.txt b/packages/fxa-auth-server/lib/senders/emails/templates/verificationReminderSecond/index.txt index 827f19ca9a1..67fb9522bd5 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/verificationReminderSecond/index.txt +++ b/packages/fxa-auth-server/lib/senders/emails/templates/verificationReminderSecond/index.txt @@ -1,6 +1,6 @@ verificationReminderSecond-title = "Still there?" -verificationReminderSecond-description = "Almost a week ago you created a Firefox account but never verified it. We’re worried about you." +verificationReminderSecond-description-2 = "Almost a week ago you created a Firefox account but never confirmed it. We’re worried about you." verificationReminderSecond-sub-description = "Confirm this email address to activate your account and let us know you’re okay." diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/verifyLoginCode/en.ftl b/packages/fxa-auth-server/lib/senders/emails/templates/verifyLoginCode/en.ftl index ea69e168028..17215466821 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/verifyLoginCode/en.ftl +++ b/packages/fxa-auth-server/lib/senders/emails/templates/verifyLoginCode/en.ftl @@ -2,5 +2,5 @@ # $serviceName (String) - A service the user hasn't signed into before (e.g. Firefox) verifyLoginCode-subject-line = Sign-in code for { $serviceName } verifyLoginCode-title = Is this you signing in? -verifyLoginCode-prompt = If yes, here is the verification code: +verifyLoginCode-prompt-2 = If yes, here is the confirmation code: verifyLoginCode-expiry-notice = It expires in 5 minutes. diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/verifyLoginCode/index.mjml b/packages/fxa-auth-server/lib/senders/emails/templates/verifyLoginCode/index.mjml index eb2f97584ab..b8f59dc8d9a 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/verifyLoginCode/index.mjml +++ b/packages/fxa-auth-server/lib/senders/emails/templates/verifyLoginCode/index.mjml @@ -15,8 +15,8 @@ - - If yes, here is the verification code: + + If yes, here is the confirmation code: diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/verifyLoginCode/index.txt b/packages/fxa-auth-server/lib/senders/emails/templates/verifyLoginCode/index.txt index 9f8544900bf..7809b892615 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/verifyLoginCode/index.txt +++ b/packages/fxa-auth-server/lib/senders/emails/templates/verifyLoginCode/index.txt @@ -2,7 +2,7 @@ verifyLoginCode-title = "Is this you signing in?" <%- include('/partials/userInfo/index.txt') %> -verifyLoginCode-prompt = "If yes, here is the verification code:" +verifyLoginCode-prompt-2 = "If yes, here is the confirmation code:" <%- code %> verifyLoginCode-expiry-notice = "It expires in 5 minutes." diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/verifyPrimary/en.ftl b/packages/fxa-auth-server/lib/senders/emails/templates/verifyPrimary/en.ftl index 3c8034cf519..d3c66979238 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/verifyPrimary/en.ftl +++ b/packages/fxa-auth-server/lib/senders/emails/templates/verifyPrimary/en.ftl @@ -1,6 +1,6 @@ -verifyPrimary-title = Verify primary email +verifyPrimary-title-2 = Confirm primary email verifyPrimary-description = A request to perform an account change has been made from the following device: verifyPrimary-subject = Confirm primary email -verifyPrimary-action = Verify email -verifyPrimary-action-plaintext = { verifyPrimary-action }: -verifyPrimary-post-verify = Once verified, account changes like adding a secondary email will become possible from this device. +verifyPrimary-action-2 = Confirm email +verifyPrimary-action-plaintext-2 = { verifyPrimary-action-2 }: +verifyPrimary-post-verify-2 = Once confirmed, account changes like adding a secondary email will become possible from this device. diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/verifyPrimary/includes.json b/packages/fxa-auth-server/lib/senders/emails/templates/verifyPrimary/includes.json index 85fc837d76f..2f6f0ae787e 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/verifyPrimary/includes.json +++ b/packages/fxa-auth-server/lib/senders/emails/templates/verifyPrimary/includes.json @@ -4,7 +4,7 @@ "message": "Confirm primary email" }, "action": { - "id": "verifyPrimary-action", - "message": "Verify email" + "id": "verifyPrimary-action-2", + "message": "Confirm email" } } diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/verifyPrimary/index.mjml b/packages/fxa-auth-server/lib/senders/emails/templates/verifyPrimary/index.mjml index f27c4310265..4b4de17081b 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/verifyPrimary/index.mjml +++ b/packages/fxa-auth-server/lib/senders/emails/templates/verifyPrimary/index.mjml @@ -5,7 +5,7 @@ - Verify primary email + Confirm primary email @@ -23,15 +23,15 @@ <%- include('/partials/userInfo/index.mjml') %> <%- include('/partials/button/index.mjml', { - buttonL10nId: "verifyPrimary-action", - buttonText: "Verify email" + buttonL10nId: "verifyPrimary-action-2", + buttonText: "Confirm email" }) %> - - Once verified, account changes like adding a secondary email will become + + Once confirmed, account changes like adding a secondary email will become possible from this device. diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/verifyPrimary/index.txt b/packages/fxa-auth-server/lib/senders/emails/templates/verifyPrimary/index.txt index 7d657437c0f..4f8cff57c54 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/verifyPrimary/index.txt +++ b/packages/fxa-auth-server/lib/senders/emails/templates/verifyPrimary/index.txt @@ -1,12 +1,12 @@ -verifyPrimary-title = "Verify primary email" +verifyPrimary-title-2 = "Confirm primary email" verifyPrimary-description = "A request to perform an account change has been made from the following device:" <%- include('/partials/userInfo/index.txt') %> -verifyPrimary-action-plaintext = "Verify email:" +verifyPrimary-action-plaintext-2 = "Confirm email:" <%- link %> -verifyPrimary-post-verify = "Once verified, account changes like adding a secondary email will become possible from this device." +verifyPrimary-post-verify-2 = "Once confirmed, account changes like adding a secondary email will become possible from this device." <%- include('/partials/changePassword/index.txt') %> diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/verifySecondaryCode/en.ftl b/packages/fxa-auth-server/lib/senders/emails/templates/verifySecondaryCode/en.ftl index b988d4f5f0d..3410e71f94b 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/verifySecondaryCode/en.ftl +++ b/packages/fxa-auth-server/lib/senders/emails/templates/verifySecondaryCode/en.ftl @@ -1,8 +1,8 @@ verifySecondaryCode-subject = Confirm secondary email -verifySecondaryCode-title = Verify secondary email -verifySecondaryCode-action = Verify email +verifySecondaryCode-title-2 = Confirm secondary email +verifySecondaryCode-action-2 = Confirm email # Variables: # $email (string) A user's unverified secondary email address verifySecondaryCode-explainer = A request to use { $email } as a secondary email address has been made from the following { -product-firefox-account }: -verifySecondaryCode-prompt = Use this verification code: -verifySecondaryCode-expiry-notice = It expires in 5 minutes. Once verified, this address will begin receiving security notifications and confirmations. +verifySecondaryCode-prompt-2 = Use this confirmation code: +verifySecondaryCode-expiry-notice-2 = It expires in 5 minutes. Once confirmed, this address will begin receiving security notifications and confirmations. diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/verifySecondaryCode/includes.json b/packages/fxa-auth-server/lib/senders/emails/templates/verifySecondaryCode/includes.json index 5b2f23bf1ef..2c6cc72cae0 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/verifySecondaryCode/includes.json +++ b/packages/fxa-auth-server/lib/senders/emails/templates/verifySecondaryCode/includes.json @@ -4,7 +4,7 @@ "message": "Confirm secondary email" }, "action": { - "id": "verifySecondaryCode-action", - "message": "Verify email" + "id": "verifySecondaryCode-action-2", + "message": "Confirm email" } } diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/verifySecondaryCode/index.mjml b/packages/fxa-auth-server/lib/senders/emails/templates/verifySecondaryCode/index.mjml index f393b9f2cb5..8a17c7168ed 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/verifySecondaryCode/index.mjml +++ b/packages/fxa-auth-server/lib/senders/emails/templates/verifySecondaryCode/index.mjml @@ -5,7 +5,7 @@ - Verify secondary email + Confirm secondary email @@ -19,13 +19,13 @@ - Use this verification code: + Use this confirmation code: <%- code %> - It expires in 5 minutes. Once verified, this address will begin receiving security notifications and confirmations. + It expires in 5 minutes. Once confirmed, this address will begin receiving security notifications and confirmations. diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/verifySecondaryCode/index.txt b/packages/fxa-auth-server/lib/senders/emails/templates/verifySecondaryCode/index.txt index 644cea6410e..010929dcac0 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/verifySecondaryCode/index.txt +++ b/packages/fxa-auth-server/lib/senders/emails/templates/verifySecondaryCode/index.txt @@ -1,13 +1,13 @@ -verifySecondaryCode-title = "Verify secondary email" +verifySecondaryCode-title-2 = "Confirm secondary email" verifySecondaryCode-explainer = "A request to use <%- email %> as a secondary email address has been made from the following Firefox account:" <%- include('/partials/userInfo/index.txt') %> -verifySecondaryCode-prompt = "Use this verification code:" +verifySecondaryCode-prompt-2 = "Use this confirmation code:" <%- code %> -verifySecondaryCode-expiry-notice = "It expires in 5 minutes. Once verified, this address will begin receiving security notifications and confirmations." +verifySecondaryCode-expiry-notice-2 = "It expires in 5 minutes. Once confirmed, this address will begin receiving security notifications and confirmations." <%- include('/partials/automatedEmailNoAction/index.txt') %> <%- include('/partials/support/index.txt') %> diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/verifyShortCode/en.ftl b/packages/fxa-auth-server/lib/senders/emails/templates/verifyShortCode/en.ftl index e595d91a4bb..1e31b773bb6 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/verifyShortCode/en.ftl +++ b/packages/fxa-auth-server/lib/senders/emails/templates/verifyShortCode/en.ftl @@ -1,6 +1,6 @@ # Variables: # $code (Number) - e.g. 123456 -verifyShortCode-subject = Verification code: { $code } +verifyShortCode-subject-2 = Confirmation code: { $code } verifyShortCode-title = Is this you signing up? -verifyShortCode-prompt = If yes, use this verification code in your registration form: +verifyShortCode-prompt-2 = If yes, use this confirmation code in your registration form: verifyShortCode-expiry-notice = It expires in 5 minutes. diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/verifyShortCode/includes.json b/packages/fxa-auth-server/lib/senders/emails/templates/verifyShortCode/includes.json index 7f3fc48e23f..c4e3e0be182 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/verifyShortCode/includes.json +++ b/packages/fxa-auth-server/lib/senders/emails/templates/verifyShortCode/includes.json @@ -1,6 +1,6 @@ { "subject": { - "id": "verifyShortCode-subject", - "message": "Verification code: <%- code %>" + "id": "verifyShortCode-subject-2", + "message": "Confirmation code: <%- code %>" } } diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/verifyShortCode/index.mjml b/packages/fxa-auth-server/lib/senders/emails/templates/verifyShortCode/index.mjml index a5f16120067..d5f776cd22d 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/verifyShortCode/index.mjml +++ b/packages/fxa-auth-server/lib/senders/emails/templates/verifyShortCode/index.mjml @@ -15,7 +15,7 @@ - If yes, use this verification code in your registration form: + If yes, use this confirmation code in your registration form: <%- code %> diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/verifyShortCode/index.txt b/packages/fxa-auth-server/lib/senders/emails/templates/verifyShortCode/index.txt index 9c66edd3553..f9dcc5cf37b 100644 --- a/packages/fxa-auth-server/lib/senders/emails/templates/verifyShortCode/index.txt +++ b/packages/fxa-auth-server/lib/senders/emails/templates/verifyShortCode/index.txt @@ -2,7 +2,7 @@ verifyShortCode-title = "Is this you signing up?" <%- include('/partials/userInfo/index.txt') %> -verifyShortCode-prompt = "If yes, use this verification code in your registration form:" +verifyShortCode-prompt-2 = "If yes, use this confirmation code in your registration form:" <%- code %> verifyShortCode-expiry-notice = "It expires in 5 minutes." diff --git a/packages/fxa-auth-server/lib/verification-reminders.js b/packages/fxa-auth-server/lib/verification-reminders.js index 92147ecb7f4..de044d5e4a0 100644 --- a/packages/fxa-auth-server/lib/verification-reminders.js +++ b/packages/fxa-auth-server/lib/verification-reminders.js @@ -71,7 +71,7 @@ module.exports = (log, config) => { const key = matches[1]; if (key === METADATA_KEY) { - throw new Error('Invalid verification reminder key found in config'); + throw new Error('Invalid confirmation reminder key found in config'); } keys.push(key); diff --git a/packages/fxa-auth-server/scripts/e2e-email/localeQuirks.js b/packages/fxa-auth-server/scripts/e2e-email/localeQuirks.js index 9e4edfac3a4..790c8f67cb6 100644 --- a/packages/fxa-auth-server/scripts/e2e-email/localeQuirks.js +++ b/packages/fxa-auth-server/scripts/e2e-email/localeQuirks.js @@ -13,7 +13,7 @@ const translationQuirks = { // 'content-language' header of 'en-US' 'content-language': [], - 'Verify your Firefox Account': [ + 'Confirm your Firefox Account': [ 'en', 'en-GB', 'ar', @@ -24,7 +24,7 @@ const translationQuirks = { 'lt', ], - 'Firefox Account Verified': [ + 'Firefox Account Confirmed': [ 'en', 'en-GB', 'ar', @@ -46,7 +46,7 @@ const translationQuirks = { 'lt', ], - 'Re-verify your Firefox Account': [ + 'Re-confirm your Firefox Account': [ 'en', 'en-GB', 'ar', diff --git a/packages/fxa-auth-server/scripts/e2e-email/validate-email.js b/packages/fxa-auth-server/scripts/e2e-email/validate-email.js index 5a084d68c65..a973480cd28 100644 --- a/packages/fxa-auth-server/scripts/e2e-email/validate-email.js +++ b/packages/fxa-auth-server/scripts/e2e-email/validate-email.js @@ -30,13 +30,13 @@ function ensureHeader(headers, key, lang) { const messageContentChecks = [ { - subject: 'Verify your Firefox Account', + subject: 'Confirm your Firefox Account', pathname: '/v1/verify_email', args: ['code', 'service', 'uid'], xheaders: ['x-service-id', 'x-uid', 'x-verify-code'], }, { - subject: 'Firefox Account Verified', + subject: 'Firefox Account Confirmed', pathname: '/firefox/sync/', args: ['utm_source', 'utm_medium', 'utm_campaign'], xheaders: [], diff --git a/packages/fxa-auth-server/test/local/routes/account.js b/packages/fxa-auth-server/test/local/routes/account.js index 603241b9793..be1c0871a6e 100644 --- a/packages/fxa-auth-server/test/local/routes/account.js +++ b/packages/fxa-auth-server/test/local/routes/account.js @@ -3428,7 +3428,7 @@ describe('/account/keys', () => { ); assert.equal( response.message, - 'Unverified account', + 'Unconfirmed account', 'correct error message' ); } diff --git a/packages/fxa-auth-server/test/local/routes/emails.js b/packages/fxa-auth-server/test/local/routes/emails.js index 9082bf9df6f..20b3957051e 100644 --- a/packages/fxa-auth-server/test/local/routes/emails.js +++ b/packages/fxa-auth-server/test/local/routes/emails.js @@ -1178,7 +1178,7 @@ describe('/recovery_email', () => { assert.fail( 'Should have failed adding secondary email with unverified primary email' ), - (err) => assert.equal(err.errno, 104, 'unverified account') + (err) => assert.equal(err.errno, 104, 'unconfirmed account') ); }); @@ -1329,7 +1329,7 @@ describe('/recovery_email', () => { assert.equal( err.errno, 195, - 'cannot add secondary email, unverified account has active subscription' + 'cannot add secondary email, unconfirmed account has active subscription' ) ); }); @@ -1656,7 +1656,7 @@ describe('/recovery_email', () => { await assert.failsAsync(runTest(route, mockRequest), { errno: 105, - message: 'Invalid verification code', + message: 'Invalid confirmation code', }); }); @@ -1666,7 +1666,7 @@ describe('/recovery_email', () => { await assert.failsAsync(runTest(route, mockRequest), { errno: 105, - message: 'Invalid verification code', + message: 'Invalid confirmation code', }); }); }); diff --git a/packages/fxa-auth-server/test/local/senders/emails.ts b/packages/fxa-auth-server/test/local/senders/emails.ts index 851462d0871..d02161aaf8f 100644 --- a/packages/fxa-auth-server/test/local/senders/emails.ts +++ b/packages/fxa-auth-server/test/local/senders/emails.ts @@ -354,7 +354,7 @@ const TESTS: [string, any, Record?][] = [ {updateTemplateValues: values => ({...values, numberRemaining: 1 })}], ['postVerifyEmail', new Map([ - ['subject', { test: 'equal', expected: 'Account verified. Next, sync another device to finish setup' }], + ['subject', { test: 'equal', expected: 'Account confirmed. Next, sync another device to finish setup' }], ['headers', new Map([ ['X-Link', { test: 'equal', expected: configUrl('syncUrl', 'account-verified', 'connect-device') }], ['X-SES-MESSAGE-TAGS', { test: 'equal', expected: sesMessageTagsHeaderValue('postVerify') }], @@ -362,8 +362,8 @@ const TESTS: [string, any, Record?][] = [ ['X-Template-Version', { test: 'equal', expected: TEMPLATE_VERSIONS.postVerify }], ])], ['html', [ - { test: 'include', expected: 'Account verified. Next, sync another device to finish setup' }, - { test: 'include', expected: "Firefox account verified. You’re almost there." }, + { test: 'include', expected: 'Account confirmed. Next, sync another device to finish setup' }, + { test: 'include', expected: "Firefox account confirmed. You’re almost there." }, { test: 'include', expected: 'Next sync between your devices!' }, { test: 'include', expected: 'Sync privately keeps your bookmarks, passwords and other Firefox data the same across all your devices.' }, { test: 'include', expected: decodeUrl(configHref('syncUrl', 'account-verified', 'connect-device')) }, @@ -377,7 +377,7 @@ const TESTS: [string, any, Record?][] = [ { test: 'include', expected: 'alt="Devices"' }, ]], ['text', [ - { test: 'include', expected: 'Firefox account verified. You’re almost there.' }, + { test: 'include', expected: 'Firefox account confirmed. You’re almost there.' }, { test: 'include', expected: 'Next sync between your devices!' }, { test: 'include', expected: 'Sync privately keeps your bookmarks, passwords and other Firefox data the same across all your devices.' }, { test: 'include', expected: `Mozilla Privacy Policy\n${configUrl('privacyUrl', 'account-verified', 'privacy')}` }, @@ -496,7 +496,7 @@ const TESTS: [string, any, Record?][] = [ ])], ['verifyShortCodeEmail', new Map([ - ['subject', { test: 'equal', expected: `Verification code: ${MESSAGE.code}` }], + ['subject', { test: 'equal', expected: `Confirmation code: ${MESSAGE.code}` }], ['headers', new Map([ ['X-SES-MESSAGE-TAGS', { test: 'equal', expected: sesMessageTagsHeaderValue('verify') }], ['X-Template-Name', { test: 'equal', expected: 'verifyShortCode' }], @@ -504,7 +504,7 @@ const TESTS: [string, any, Record?][] = [ ['X-Verify-Short-Code', { test: 'equal', expected: MESSAGE.code }], ])], ['html', [ - { test: 'include', expected: `Verification code: ${MESSAGE.code}` }, + { test: 'include', expected: `Confirmation code: ${MESSAGE.code}` }, { test: 'include', expected: 'Is this you signing up?' }, { test: 'include', expected: decodeUrl(configHref('privacyUrl', 'welcome', 'privacy')) }, { test: 'include', expected: decodeUrl(configHref('supportUrl', 'welcome', 'support')) }, @@ -513,7 +513,7 @@ const TESTS: [string, any, Record?][] = [ { test: 'include', expected: `${MESSAGE.device.uaBrowser} on ${MESSAGE.device.uaOS} ${MESSAGE.device.uaOSVersion}` }, { test: 'include', expected: `${MESSAGE.date}` }, { test: 'exists', expected: `${MESSAGE.time}` }, - { test: 'include', expected: 'If yes, use this verification code in your registration form:' }, + { test: 'include', expected: 'If yes, use this confirmation code in your registration form:' }, { test: 'include', expected: MESSAGE.code }, { test: 'notInclude', expected: 'utm_source=email' }, ]], @@ -525,7 +525,7 @@ const TESTS: [string, any, Record?][] = [ { test: 'include', expected: `${MESSAGE.location.city}, ${MESSAGE.location.stateCode}, ${MESSAGE.location.country} (estimated)` }, { test: 'include', expected: `${MESSAGE.date}` }, { test: 'exists', expected: `${MESSAGE.time}` }, - { test: 'include', expected: `If yes, use this verification code in your registration form:\n${MESSAGE.code}` }, + { test: 'include', expected: `If yes, use this confirmation code in your registration form:\n${MESSAGE.code}` }, { test: 'notInclude', expected: 'utm_source=email' }, ]], ])], @@ -538,16 +538,16 @@ const TESTS: [string, any, Record?][] = [ ['X-Template-Version', { test: 'equal', expected: TEMPLATE_VERSIONS.verifySecondaryCode }], ])], ['html', [ - { test: 'include', expected: 'Verify secondary email' }, + { test: 'include', expected: 'Confirm secondary email' }, { test: 'include', expected: decodeUrl(configHref('privacyUrl', 'welcome-secondary', 'privacy')) }, { test: 'include', expected: decodeUrl(configHref('supportUrl', 'welcome-secondary', 'support')) }, { test: 'include', expected: `A request to use ${MESSAGE.email} as a secondary email address has been made from the following Firefox account:` }, { test: 'include', expected: `IP address: ${MESSAGE.ip}` }, { test: 'include', expected: `${MESSAGE.location.city}, ${MESSAGE.location.stateCode}, ${MESSAGE.location.country} (estimated)` }, { test: 'include', expected: `${MESSAGE.device.uaBrowser} on ${MESSAGE.device.uaOS} ${MESSAGE.device.uaOSVersion}` }, - { test: 'include', expected: 'Use this verification code:' }, + { test: 'include', expected: 'Use this confirmation code:' }, { test: 'include', expected: `${MESSAGE.code}` }, - { test: 'include', expected: 'It expires in 5 minutes. Once verified, this address will begin receiving security notifications and confirmations.' }, + { test: 'include', expected: 'It expires in 5 minutes. Once confirmed, this address will begin receiving security notifications and confirmations.' }, { test: 'include', expected: `${MESSAGE.date}` }, { test: 'exists', expected: `${MESSAGE.time}` }, { test: 'notInclude', expected: 'utm_source=email' }, @@ -555,14 +555,14 @@ const TESTS: [string, any, Record?][] = [ ['text', [ { test: 'include', expected: configUrl('privacyUrl', 'welcome-secondary', 'privacy') }, { test: 'include', expected: configUrl('supportUrl', 'welcome-secondary', 'support') }, - { test: 'include', expected: 'Verify secondary email' }, + { test: 'include', expected: 'Confirm secondary email' }, { test: 'include', expected: `A request to use ${MESSAGE.email} as a secondary email address has been made from the following Firefox account:` }, { test: 'include', expected: `IP address: ${MESSAGE.ip}` }, { test: 'include', expected: `${MESSAGE.location.city}, ${MESSAGE.location.stateCode}, ${MESSAGE.location.country} (estimated)` }, { test: 'include', expected: `${MESSAGE.device.uaBrowser} on ${MESSAGE.device.uaOS} ${MESSAGE.device.uaOSVersion}` }, - { test: 'include', expected: 'Use this verification code:' }, + { test: 'include', expected: 'Use this confirmation code:' }, { test: 'include', expected: `${MESSAGE.code}` }, - { test: 'include', expected: 'It expires in 5 minutes. Once verified, this address will begin receiving security notifications and confirmations.' }, + { test: 'include', expected: 'It expires in 5 minutes. Once confirmed, this address will begin receiving security notifications and confirmations.' }, { test: 'include', expected: `${MESSAGE.date}` }, { test: 'exists', expected: `${MESSAGE.time}` }, { test: 'notInclude', expected: 'utm_source=email' }, @@ -751,7 +751,7 @@ const TESTS: [string, any, Record?][] = [ ])], ['html', [ { test: 'include', expected: 'Confirm primary email' }, - { test: 'include', expected: 'Verify primary email' }, + { test: 'include', expected: 'Confirm primary email' }, { test: 'include', expected: decodeUrl(configHref('initiatePasswordChangeUrl', 'welcome-primary', 'change-password', 'email')) }, { test: 'include', expected: decodeUrl(configHref('privacyUrl', 'welcome-primary', 'privacy')) }, { test: 'include', expected: decodeUrl(configHref('supportUrl', 'welcome-primary', 'support')) }, @@ -764,11 +764,11 @@ const TESTS: [string, any, Record?][] = [ { test: 'notInclude', expected: 'utm_source=email' }, ]], ['text', [ - { test: 'include', expected: 'Verify primary email' }, + { test: 'include', expected: 'Confirm primary email' }, { test: 'include', expected: `please change your password.\n${configUrl('initiatePasswordChangeUrl', 'welcome-primary', 'change-password', 'email')}` }, { test: 'include', expected: `Mozilla Privacy Policy\n${configUrl('privacyUrl', 'welcome-primary', 'privacy')}` }, { test: 'include', expected: `For more information, please visit ${configUrl('supportUrl', 'welcome-primary', 'support')}` }, - { test: 'include', expected: `Verify email:\n${configUrl('verifyPrimaryEmailUrl', 'welcome-primary', 'activate', 'code', 'uid', 'type=primary', 'primary_email_verified', 'service')}` }, + { test: 'include', expected: `Confirm email:\n${configUrl('verifyPrimaryEmailUrl', 'welcome-primary', 'activate', 'code', 'uid', 'type=primary', 'primary_email_verified', 'service')}` }, { test: 'include', expected: `IP address: ${MESSAGE.ip}` }, { test: 'include', expected: `${MESSAGE.location.city}, ${MESSAGE.location.stateCode}, ${MESSAGE.location.country} (estimated)` }, { test: 'include', expected: `${MESSAGE.device.uaBrowser} on ${MESSAGE.device.uaOS} ${MESSAGE.device.uaOSVersion}` }, @@ -837,7 +837,7 @@ const TESTS: [string, any, Record?][] = [ { test: 'include', expected: `please change your password.\n${configUrl('initiatePasswordChangeUrl', 'new-signin-verify-code', 'change-password', 'email')}` }, { test: 'include', expected: `Mozilla Privacy Policy\n${configUrl('privacyUrl', 'new-signin-verify-code', 'privacy')}` }, { test: 'include', expected: `For more information, please visit ${configUrl('supportUrl', 'new-signin-verify-code', 'support')}` }, - { test: 'include', expected: `If yes, here is the verification code:\n${MESSAGE.code}` }, + { test: 'include', expected: `If yes, here is the confirmation code:\n${MESSAGE.code}` }, { test: 'include', expected: `${MESSAGE.date}` }, { test: 'exists', expected: `${MESSAGE.time}` }, { test: 'notInclude', expected: 'utm_source=email' }, @@ -1023,7 +1023,7 @@ const TESTS: [string, any, Record?][] = [ ['X-Template-Version', { test: 'equal', expected: TEMPLATE_VERSIONS.postVerifySecondary }], ])], ['html', [ - { test: 'include', expected: `You have successfully verified ${MESSAGE.secondaryEmail}` }, + { test: 'include', expected: `You have successfully confirmed ${MESSAGE.secondaryEmail}` }, { test: 'include', expected: decodeUrl(configHref('accountSettingsUrl', 'account-email-verified', 'manage-account', 'email', 'uid')) }, { test: 'include', expected: decodeUrl(configHref('initiatePasswordChangeUrl', 'account-email-verified', 'change-password', 'email')) }, { test: 'include', expected: decodeUrl(configHref('privacyUrl', 'account-email-verified', 'privacy')) }, @@ -1032,7 +1032,7 @@ const TESTS: [string, any, Record?][] = [ ]], ['text', [ { test: 'include', expected: 'Secondary email added' }, - { test: 'include', expected: `You have successfully verified ${MESSAGE.secondaryEmail}` }, + { test: 'include', expected: `You have successfully confirmed ${MESSAGE.secondaryEmail}` }, { test: 'include', expected: `Manage account:\n${configUrl('accountSettingsUrl', 'account-email-verified', 'manage-account', 'email', 'uid')}` }, { test: 'include', expected: `please change your password.\n${configUrl('initiatePasswordChangeUrl', 'account-email-verified', 'change-password', 'email')}` }, { test: 'include', expected: `Mozilla Privacy Policy\n${configUrl('privacyUrl', 'account-email-verified', 'privacy')}` }, diff --git a/packages/fxa-auth-server/test/local/senders/renderer.ts b/packages/fxa-auth-server/test/local/senders/renderer.ts index 7f2539d9ae5..1a504726931 100644 --- a/packages/fxa-auth-server/test/local/senders/renderer.ts +++ b/packages/fxa-auth-server/test/local/senders/renderer.ts @@ -120,21 +120,15 @@ describe('Renderer', () => { }); it('localizes and then renders if "<%" is present', async () => { - const rendererContextMods = { - ...rendererContext, - templateValues: { - code: '123abc', - }, - }; const result = await renderer.localizeAndRender( undefined, { - id: 'verifyShortCode-subject', - message: 'Verification code: <%- code %>', + id: 'verifyShortCode-title', + message: 'Is this you signing up?', }, - rendererContextMods + rendererContext ); - assert.equal(result, 'Codice di verifica: 123abc'); + assert.equal(result, 'Hai effettuato tu questo accesso?'); }); }); }); diff --git a/packages/fxa-auth-server/test/remote/account_create_tests.js b/packages/fxa-auth-server/test/remote/account_create_tests.js index bc710b34ee8..df8068ebd94 100644 --- a/packages/fxa-auth-server/test/remote/account_create_tests.js +++ b/packages/fxa-auth-server/test/remote/account_create_tests.js @@ -71,7 +71,7 @@ describe('remote account create', function () { assert.equal(err.errno, 104, 'Unverified account error code'); assert.equal( err.message, - 'Unverified account', + 'Unconfirmed account', 'Unverified account error message' ); } diff --git a/packages/fxa-auth-server/test/remote/account_signin_verification_tests.js b/packages/fxa-auth-server/test/remote/account_signin_verification_tests.js index 8ce85d3b6e6..f2c3a8ca795 100644 --- a/packages/fxa-auth-server/test/remote/account_signin_verification_tests.js +++ b/packages/fxa-auth-server/test/remote/account_signin_verification_tests.js @@ -423,7 +423,7 @@ describe('remote account signin verification', function () { assert.equal(err.code, 400, 'Correct error code'); assert.equal( err.message, - 'Unverified session', + 'Unconfirmed session', 'Correct error message' ); } @@ -626,7 +626,7 @@ describe('remote account signin verification', function () { assert.equal(err.code, 400, 'Correct error code'); assert.equal( err.message, - 'Unverified account', + 'Unconfirmed account', 'Correct error message' ); }) @@ -697,7 +697,7 @@ describe('remote account signin verification', function () { assert.equal(err.code, 400, 'Correct error code'); assert.equal( err.message, - 'Unverified account', + 'Unconfirmed account', 'Correct error message' ); } diff --git a/packages/fxa-auth-server/test/remote/password_forgot_tests.js b/packages/fxa-auth-server/test/remote/password_forgot_tests.js index dc3a462d7cc..0c3cbdaf091 100644 --- a/packages/fxa-auth-server/test/remote/password_forgot_tests.js +++ b/packages/fxa-auth-server/test/remote/password_forgot_tests.js @@ -167,7 +167,7 @@ describe('remote password forgot', function () { assert.equal(err.tries, 2, 'used a try'); assert.equal( err.message, - 'Invalid verification code', + 'Invalid confirmation code', 'bad attempt 1' ); } @@ -187,7 +187,7 @@ describe('remote password forgot', function () { assert.equal(err.tries, 1, 'used a try'); assert.equal( err.message, - 'Invalid verification code', + 'Invalid confirmation code', 'bad attempt 2' ); } @@ -207,7 +207,7 @@ describe('remote password forgot', function () { assert.equal(err.tries, 0, 'used a try'); assert.equal( err.message, - 'Invalid verification code', + 'Invalid confirmation code', 'bad attempt 3' ); } diff --git a/packages/fxa-auth-server/test/remote/recovery_email_verify_tests.js b/packages/fxa-auth-server/test/remote/recovery_email_verify_tests.js index 5b7cbb64431..13c57995dad 100644 --- a/packages/fxa-auth-server/test/remote/recovery_email_verify_tests.js +++ b/packages/fxa-auth-server/test/remote/recovery_email_verify_tests.js @@ -44,7 +44,7 @@ describe('remote recovery email verify', function () { (err) => { assert.equal( err.message.toString(), - 'Invalid verification code', + 'Invalid confirmation code', 'bad attempt' ); } diff --git a/packages/fxa-content-server/app/scripts/templates/complete_sign_up.mustache b/packages/fxa-content-server/app/scripts/templates/complete_sign_up.mustache index 56bb4f9f074..bb6d1eff276 100644 --- a/packages/fxa-content-server/app/scripts/templates/complete_sign_up.mustache +++ b/packages/fxa-content-server/app/scripts/templates/complete_sign_up.mustache @@ -20,7 +20,7 @@ {{#isLinkExpired}}
    -

    {{#t}}Verification link expired{{/t}}

    +

    {{#t}}Confirmation link expired{{/t}}

    @@ -28,12 +28,12 @@

    - {{#t}}The link you clicked to verify your email is expired.{{/t}} + {{#t}}The link you clicked to confirm your email is expired.{{/t}}

    {{#canResend}} {{/canResend}}
    @@ -41,7 +41,7 @@ {{#isLinkDamaged}}
    -

    {{#t}}Verification link damaged{{/t}}

    +

    {{#t}}Confirmation link damaged{{/t}}

    @@ -53,7 +53,7 @@ {{#error}}
    -

    {{#t}}Verification error{{/t}}

    +

    {{#t}}Confirmation error{{/t}}

    diff --git a/packages/fxa-content-server/app/scripts/templates/confirm.mustache b/packages/fxa-content-server/app/scripts/templates/confirm.mustache index ed21e965a17..047a4bc8ee3 100644 --- a/packages/fxa-content-server/app/scripts/templates/confirm.mustache +++ b/packages/fxa-content-server/app/scripts/templates/confirm.mustache @@ -15,7 +15,7 @@
    {{#isSignUp}} -

    {{#unsafeTranslate}}Check your email for the verification link sent to %(escapedEmail)s{{/unsafeTranslate}}

    +

    {{#unsafeTranslate}}Check your email for the confirmation link sent to %(escapedEmail)s{{/unsafeTranslate}}

    {{/isSignUp}} {{#isSignIn}}

    {{#unsafeTranslate}}Check your email for the sign-in confirmation link sent to %(escapedEmail)s{{/unsafeTranslate}}

    diff --git a/packages/fxa-content-server/app/scripts/templates/connect_another_device.mustache b/packages/fxa-content-server/app/scripts/templates/connect_another_device.mustache index 133896f64d5..41440f4b939 100644 --- a/packages/fxa-content-server/app/scripts/templates/connect_another_device.mustache +++ b/packages/fxa-content-server/app/scripts/templates/connect_another_device.mustache @@ -6,7 +6,7 @@ {{/isSignedIn}} {{^isSignedIn}} {{#isSignUp}} -
    {{#t}}Email verified{{/t}}
    +
    {{#t}}Email confirmed{{/t}}
    {{/isSignUp}} {{#isSignIn}}
    {{#t}}Sign-in confirmed{{/t}}
    diff --git a/packages/fxa-content-server/app/scripts/templates/post_verify/secondary_email/confirm_secondary_email.mustache b/packages/fxa-content-server/app/scripts/templates/post_verify/secondary_email/confirm_secondary_email.mustache index bc220baa86c..4059a7debe7 100644 --- a/packages/fxa-content-server/app/scripts/templates/post_verify/secondary_email/confirm_secondary_email.mustache +++ b/packages/fxa-content-server/app/scripts/templates/post_verify/secondary_email/confirm_secondary_email.mustache @@ -3,10 +3,10 @@

    {{#serviceName}} - {{#t}}Enter verification code{{/t}} {{#t}}Continue to %(serviceName)s{{/t}} + {{#t}}Enter confirmation code{{/t}} {{#t}}Continue to %(serviceName)s{{/t}} {{/serviceName}} {{^serviceName}} - {{#t}}Enter verification code{{/t}} + {{#t}}Enter confirmation code{{/t}} {{/serviceName}}

    @@ -17,14 +17,14 @@
    -

    {{#unsafeTranslate}}Please enter the verification code that was sent to %(escapedEmail)s within 5 minutes.{{/unsafeTranslate}}

    +

    {{#unsafeTranslate}}Please enter the confirmation code that was sent to %(escapedEmail)s within 5 minutes.{{/unsafeTranslate}}

    - +
    - +
    diff --git a/packages/fxa-content-server/app/scripts/templates/sign_in_totp_code.mustache b/packages/fxa-content-server/app/scripts/templates/sign_in_totp_code.mustache index 963dc15d151..3a4b55e8222 100644 --- a/packages/fxa-content-server/app/scripts/templates/sign_in_totp_code.mustache +++ b/packages/fxa-content-server/app/scripts/templates/sign_in_totp_code.mustache @@ -21,7 +21,7 @@
  • - +
    diff --git a/packages/fxa-content-server/app/scripts/views/behaviors/settings.js b/packages/fxa-content-server/app/scripts/views/behaviors/settings.js index 9ea037287b2..c117c91471a 100644 --- a/packages/fxa-content-server/app/scripts/views/behaviors/settings.js +++ b/packages/fxa-content-server/app/scripts/views/behaviors/settings.js @@ -23,7 +23,7 @@ export default function (defaultBehavior, options = {}) { const behavior = function (view, account) { return account.isSignedIn().then((isSignedIn) => { if (isSignedIn) { - let success = t('Account verified successfully'); + let success = t('Account confirmed successfully'); let endpoint = 'settings'; // Strict comparison because undefined == null, but undefined !== null, and diff --git a/packages/fxa-content-server/app/scripts/views/post_verify/verified.js b/packages/fxa-content-server/app/scripts/views/post_verify/verified.js index 982f9437a2c..02921911799 100644 --- a/packages/fxa-content-server/app/scripts/views/post_verify/verified.js +++ b/packages/fxa-content-server/app/scripts/views/post_verify/verified.js @@ -29,7 +29,7 @@ const TEMPLATE_INFO = { ), buttonText: t('Continue to %(serviceName)s '), headerId: 'fxa-secondary-email-complete-header', - headerTitle: t('Secondary email verified'), + headerTitle: t('Secondary email confirmed'), }, }; diff --git a/packages/fxa-content-server/app/scripts/views/ready.js b/packages/fxa-content-server/app/scripts/views/ready.js index 96a71ede275..bb19a59d529 100644 --- a/packages/fxa-content-server/app/scripts/views/ready.js +++ b/packages/fxa-content-server/app/scripts/views/ready.js @@ -54,14 +54,14 @@ const TEMPLATE_INFO = { 'You are now ready to make changes to your Firefox Account.' ), headerId: 'fxa-sign-up-complete-header', - headerTitle: t('Primary email verified'), + headerTitle: t('Primary email confirmed'), }, SECONDARY_EMAIL_VERIFIED: { emailReadyText: t( 'Account notifications will now also be sent to %(secondaryEmailVerified)s.' ), headerId: 'fxa-sign-up-complete-header', - headerTitle: t('Secondary email verified'), + headerTitle: t('Secondary email confirmed'), }, // signin_confirmed and signin_verified are only shown to Sync for now. SIGN_IN: { @@ -71,7 +71,7 @@ const TEMPLATE_INFO = { }, SIGN_UP: { headerId: 'fxa-sign-up-complete-header', - headerTitle: t('Account verified'), + headerTitle: t('Account confirmed'), readyToSyncText: t('You are now ready to use %(serviceName)s'), }, SUCCESSFUL_OAUTH: { diff --git a/packages/fxa-content-server/tests/functional/settings/secondary_email.js b/packages/fxa-content-server/tests/functional/settings/secondary_email.js index dc8cd18ba8e..73b0512bb9e 100644 --- a/packages/fxa-content-server/tests/functional/settings/secondary_email.js +++ b/packages/fxa-content-server/tests/functional/settings/secondary_email.js @@ -76,7 +76,7 @@ describe('secondary email', () => { ); await testElementTextInclude( selectors.SETTINGS.SECONDARY_EMAIL.HEADER_VALUE, - 'unverified' + 'unconfirmed' ); await testElementExists(selectors.SETTINGS.SECONDARY_EMAIL.DELETE_BUTTON); await testElementExists(selectors.SETTINGS.SECONDARY_EMAIL.REFRESH_BUTTON); diff --git a/packages/fxa-settings/src/components/ModalVerifySession/en-US.ftl b/packages/fxa-settings/src/components/ModalVerifySession/en-US.ftl index f5e26800709..be25456c207 100644 --- a/packages/fxa-settings/src/components/ModalVerifySession/en-US.ftl +++ b/packages/fxa-settings/src/components/ModalVerifySession/en-US.ftl @@ -1,10 +1,10 @@ ## Modal Verify Session -mvs-verify-your-email = Verify your email -mvs-enter-verification-code = Enter your verification code -# This string is used to show a notification to the user for them to enter verification code to verify their email. +mvs-verify-your-email-2 = Confirm your email +mvs-enter-verification-code-2 = Enter your confirmation code +# This string is used to show a notification to the user for them to enter confirmation code to confirm their email. # Variables: # email (String) - the user's email -mvs-enter-verification-code-desc = Please enter the verification code that was sent to { $email } within 5 minutes. +mvs-enter-verification-code-desc-2 = Please enter the confirmation code that was sent to { $email } within 5 minutes. msv-cancel-button = Cancel -msv-submit-button = Verify +msv-submit-button-2 = Confirm diff --git a/packages/fxa-settings/src/components/ModalVerifySession/index.tsx b/packages/fxa-settings/src/components/ModalVerifySession/index.tsx index 6289c2b5ea8..a2d31bad097 100644 --- a/packages/fxa-settings/src/components/ModalVerifySession/index.tsx +++ b/packages/fxa-settings/src/components/ModalVerifySession/index.tsx @@ -9,7 +9,7 @@ import InputText from '../InputText'; import { ApolloError } from '@apollo/client'; import { useAccount, useSession } from '../../models'; import { Localized, useLocalization } from '@fluent/react'; -import { AuthUiErrors } from 'fxa-settings/src/lib/auth-errors/auth-errors'; +import { AuthUiErrors, composeAuthUiErrorTranslationID } from 'fxa-settings/src/lib/auth-errors/auth-errors'; type ModalProps = { onDismiss: () => void; @@ -46,7 +46,7 @@ export const ModalVerifySession = ({ } catch (e) { if (e.errno === AuthUiErrors.INVALID_EXPIRED_SIGNUP_CODE.errno) { const errorText = l10n.getString( - `auth-error-${AuthUiErrors.INVALID_EXPIRED_SIGNUP_CODE.errno}`, + composeAuthUiErrorTranslationID(e), null, AuthUiErrors.INVALID_EXPIRED_SIGNUP_CODE.message ); @@ -88,11 +88,11 @@ export const ModalVerifySession = ({ > @@ -104,11 +104,11 @@ export const ModalVerifySession = ({ }} > @@ -118,9 +118,9 @@ export const ModalVerifySession = ({ { if (errorText) { @@ -147,14 +147,14 @@ export const ModalVerifySession = ({ Cancel - + diff --git a/packages/fxa-settings/src/components/PageChangePassword/index.tsx b/packages/fxa-settings/src/components/PageChangePassword/index.tsx index f659bdfd833..e82987b37f9 100644 --- a/packages/fxa-settings/src/components/PageChangePassword/index.tsx +++ b/packages/fxa-settings/src/components/PageChangePassword/index.tsx @@ -13,7 +13,7 @@ import { } from '../../lib/metrics'; import { useAccount, useAlertBar } from '../../models'; import FlowContainer from '../FlowContainer'; -import { AuthUiErrors } from '../../lib/auth-errors/auth-errors'; +import { AuthUiErrors, composeAuthUiErrorTranslationID } from '../../lib/auth-errors/auth-errors'; import { useLocalization, Localized } from '@fluent/react'; import FormPassword from '../FormPassword'; @@ -62,7 +62,7 @@ export const PageChangePassword = ({}: RouteComponentProps) => { async ({ oldPassword, newPassword }: FormData) => { if (oldPassword === newPassword) { const localizedError = l10n.getString( - `auth-error-${AuthUiErrors.PASSWORDS_MUST_BE_DIFFERENT.errno}`, + composeAuthUiErrorTranslationID(AuthUiErrors.PASSWORDS_MUST_BE_DIFFERENT), null, AuthUiErrors.PASSWORDS_MUST_BE_DIFFERENT.message ); @@ -75,7 +75,7 @@ export const PageChangePassword = ({}: RouteComponentProps) => { alertSuccessAndGoHome(); } catch (e) { const localizedError = l10n.getString( - `auth-error-${AuthUiErrors.INCORRECT_PASSWORD.errno}`, + composeAuthUiErrorTranslationID(AuthUiErrors.INCORRECT_PASSWORD), null, AuthUiErrors.INCORRECT_PASSWORD.message ); diff --git a/packages/fxa-settings/src/components/PageDeleteAccount/index.tsx b/packages/fxa-settings/src/components/PageDeleteAccount/index.tsx index eb355e7361c..d5205a009e1 100644 --- a/packages/fxa-settings/src/components/PageDeleteAccount/index.tsx +++ b/packages/fxa-settings/src/components/PageDeleteAccount/index.tsx @@ -14,7 +14,7 @@ import { logViewEvent, usePageViewEvent } from '../../lib/metrics'; import { Checkbox } from '../Checkbox'; import { useLocalization } from '@fluent/react'; import { Localized } from '@fluent/react'; -import { AuthUiErrors } from '../../lib/auth-errors/auth-errors'; +import { AuthUiErrors, composeAuthUiErrorTranslationID } from '../../lib/auth-errors/auth-errors'; type FormData = { password: string; @@ -76,7 +76,7 @@ export const PageDeleteAccount = (_: RouteComponentProps) => { window.location.href = `${ROOTPATH}?delete_account_success=true`; } catch (e) { const localizedError = l10n.getString( - `auth-error-${AuthUiErrors.INCORRECT_PASSWORD.errno}`, + composeAuthUiErrorTranslationID(AuthUiErrors.INCORRECT_PASSWORD), null, AuthUiErrors.INCORRECT_PASSWORD.message ); diff --git a/packages/fxa-settings/src/components/PageRecoveryKeyAdd/index.test.tsx b/packages/fxa-settings/src/components/PageRecoveryKeyAdd/index.test.tsx index fc763695223..20dac9a3e88 100644 --- a/packages/fxa-settings/src/components/PageRecoveryKeyAdd/index.test.tsx +++ b/packages/fxa-settings/src/components/PageRecoveryKeyAdd/index.test.tsx @@ -131,6 +131,13 @@ describe('PageRecoveryKeyAdd', () => { account.createRecoveryKey = jest .fn() .mockResolvedValue(new Uint8Array(20)); + } else { + account.createRecoveryKey = jest + .fn() + .mockImplementation(() => { + // this is just a random key that does match a real error to keep tests passing. + throw { message: 'Example error', errno: 106 } + }) } renderWithRouter( diff --git a/packages/fxa-settings/src/components/PageRecoveryKeyAdd/index.tsx b/packages/fxa-settings/src/components/PageRecoveryKeyAdd/index.tsx index 4e3f099550d..00a82fb40f8 100644 --- a/packages/fxa-settings/src/components/PageRecoveryKeyAdd/index.tsx +++ b/packages/fxa-settings/src/components/PageRecoveryKeyAdd/index.tsx @@ -13,6 +13,7 @@ import { logViewEvent, usePageViewEvent } from '../../lib/metrics'; import { AuthUiErrors, AuthUiErrorNos, + composeAuthUiErrorTranslationID, } from '../../lib/auth-errors/auth-errors'; type FormData = { @@ -73,13 +74,13 @@ export const PageRecoveryKeyAdd = (_: RouteComponentProps) => { if (e.errno === AuthUiErrors.THROTTLED.errno) { localizedError = l10n.getString( - `auth-error-${e.errno}`, + composeAuthUiErrorTranslationID(e), { retryAfter: e.retryAfterLocalized }, AuthUiErrorNos[e.errno].message ); } else { localizedError = l10n.getString( - `auth-error-${e.errno}`, + composeAuthUiErrorTranslationID(e), null, e.message ); diff --git a/packages/fxa-settings/src/components/PageSecondaryEmailAdd/index.tsx b/packages/fxa-settings/src/components/PageSecondaryEmailAdd/index.tsx index 5d36cd14af2..e056132dc49 100644 --- a/packages/fxa-settings/src/components/PageSecondaryEmailAdd/index.tsx +++ b/packages/fxa-settings/src/components/PageSecondaryEmailAdd/index.tsx @@ -8,7 +8,7 @@ import FlowContainer from '../FlowContainer'; import VerifiedSessionGuard from '../VerifiedSessionGuard'; import { isEmailValid } from 'fxa-shared/email/helpers'; import { useAccount, useAlertBar } from 'fxa-settings/src/models'; -import { AuthUiErrorNos } from 'fxa-settings/src/lib/auth-errors/auth-errors'; +import { AuthUiErrorNos, composeAuthUiErrorTranslationID } from 'fxa-settings/src/lib/auth-errors/auth-errors'; export const PageSecondaryEmailAdd = (_: RouteComponentProps) => { usePageViewEvent('settings.emails'); @@ -37,7 +37,7 @@ export const PageSecondaryEmailAdd = (_: RouteComponentProps) => { } catch (e) { if (e.errno) { const errorText = l10n.getString( - `auth-error-${e.errno}`, + composeAuthUiErrorTranslationID(e), { retryAfter: e.retryAfterLocalized }, AuthUiErrorNos[e.errno].message ); diff --git a/packages/fxa-settings/src/components/PageSecondaryEmailVerify/en-US.ftl b/packages/fxa-settings/src/components/PageSecondaryEmailVerify/en-US.ftl index e28485f5c13..ce0e677746b 100644 --- a/packages/fxa-settings/src/components/PageSecondaryEmailVerify/en-US.ftl +++ b/packages/fxa-settings/src/components/PageSecondaryEmailVerify/en-US.ftl @@ -1,17 +1,17 @@ ## Verify secondary email page add-secondary-email-step-2 = Step 2 of 2 -verify-secondary-email-error-2 = There was a problem sending the verification code +verify-secondary-email-error-3 = There was a problem sending the confirmation code verify-secondary-email-page-title = .title = Secondary email -verify-secondary-email-verification-code = - .label = Enter your verification code +verify-secondary-email-verification-code-2 = + .label = Enter your confirmation code verify-secondary-email-cancel-button = Cancel -verify-secondary-email-verify-button = Verify +verify-secondary-email-verify-button-2 = Confirm # This string is an instruction in a form. # Variables: # $email (String) - the user's email address, which does not need translation. -verify-secondary-email-please-enter-code = Please enter the verification code that was sent to { $email } within 5 minutes. +verify-secondary-email-please-enter-code-2 = Please enter the confirmation code that was sent to { $email } within 5 minutes. # This string is a confirmation message shown after verifying an email. # Variables: # $email (String) - the user's email address, which does not need translation. diff --git a/packages/fxa-settings/src/components/PageSecondaryEmailVerify/index.tsx b/packages/fxa-settings/src/components/PageSecondaryEmailVerify/index.tsx index 4e36638e1ac..bba049de646 100644 --- a/packages/fxa-settings/src/components/PageSecondaryEmailVerify/index.tsx +++ b/packages/fxa-settings/src/components/PageSecondaryEmailVerify/index.tsx @@ -8,7 +8,7 @@ import InputText from '../InputText'; import FlowContainer from '../FlowContainer'; import VerifiedSessionGuard from '../VerifiedSessionGuard'; import { useForm } from 'react-hook-form'; -import { AuthUiErrors } from 'fxa-settings/src/lib/auth-errors/auth-errors'; +import { AuthUiErrors, composeAuthUiErrorTranslationID } from 'fxa-settings/src/lib/auth-errors/auth-errors'; type FormData = { verificationCode: string; @@ -60,7 +60,7 @@ export const PageSecondaryEmailVerify = ({ location }: RouteComponentProps) => { } catch (e) { if (e.errno) { const errorText = l10n.getString( - `auth-error-${e.errno}`, + composeAuthUiErrorTranslationID(e), null, AuthUiErrors.INVALID_VERIFICATION_CODE.message ); @@ -68,9 +68,9 @@ export const PageSecondaryEmailVerify = ({ location }: RouteComponentProps) => { } else { alertBar.error( l10n.getString( - 'verify-secondary-email-error-2', + 'verify-secondary-email-error-3', null, - 'There was a problem sending the verification code' + 'There was a problem sending the confirmation code' ) ); } @@ -100,24 +100,24 @@ export const PageSecondaryEmailVerify = ({ location }: RouteComponentProps) => { })} > }} >

    - Please enter the verification code that was sent to{' '} + Please enter the confirmation code that was sent to{' '} {email} within 5 minutes.

    { if (errorText) { setErrorText(undefined); @@ -144,14 +144,14 @@ export const PageSecondaryEmailVerify = ({ location }: RouteComponentProps) => { Cancel - +
    diff --git a/packages/fxa-settings/src/components/PageTwoStepAuthentication/en-US.ftl b/packages/fxa-settings/src/components/PageTwoStepAuthentication/en-US.ftl index 0acb48b2024..2f6cb8ff993 100644 --- a/packages/fxa-settings/src/components/PageTwoStepAuthentication/en-US.ftl +++ b/packages/fxa-settings/src/components/PageTwoStepAuthentication/en-US.ftl @@ -12,7 +12,7 @@ tfa-button-finish = Finish tfa-incorrect-totp = Incorrect two-step authentication code tfa-cannot-retrieve-code = There was a problem retrieving your code. -tfa-cannot-verify-code-2 = There was a problem verifying your recovery code +tfa-cannot-verify-code-3 = There was a problem confirming your recovery code tfa-incorrect-recovery-code = Incorrect recovery code tfa-enabled = Two-step authentication enabled diff --git a/packages/fxa-settings/src/components/PageTwoStepAuthentication/index.tsx b/packages/fxa-settings/src/components/PageTwoStepAuthentication/index.tsx index e1ca0a6cc41..43181c10673 100644 --- a/packages/fxa-settings/src/components/PageTwoStepAuthentication/index.tsx +++ b/packages/fxa-settings/src/components/PageTwoStepAuthentication/index.tsx @@ -15,7 +15,7 @@ import { checkCode, copyRecoveryCodes, getCode } from '../../lib/totp'; import { HomePath } from '../../constants'; import { logViewEvent, useMetrics } from '../../lib/metrics'; import { Localized, useLocalization } from '@fluent/react'; -import { AuthUiErrors } from '../../lib/auth-errors/auth-errors'; +import { AuthUiErrors, composeAuthUiErrorTranslationID } from '../../lib/auth-errors/auth-errors'; import { useAsync } from 'react-async-hook'; export const metricsPreInPostFix = 'settings.two-step-authentication'; @@ -92,7 +92,7 @@ export const PageTwoStepAuthentication = (_: RouteComponentProps) => { if (e.errno === AuthUiErrors.TOTP_TOKEN_NOT_FOUND.errno) { setRecoveryCodeError( l10n.getString( - `auth-error-${AuthUiErrors.TOTP_TOKEN_NOT_FOUND.errno}`, + composeAuthUiErrorTranslationID(e), null, AuthUiErrors.TOTP_TOKEN_NOT_FOUND.message ) @@ -100,9 +100,9 @@ export const PageTwoStepAuthentication = (_: RouteComponentProps) => { } else { alertBar.error( l10n.getString( - 'tfa-cannot-verify-code-2', + 'tfa-cannot-verify-code-3', null, - 'There was a problem verifying your recovery code' + 'There was a problem confirming your recovery code' ) ); } diff --git a/packages/fxa-settings/src/components/UnitRowRecoveryKey/en-US.ftl b/packages/fxa-settings/src/components/UnitRowRecoveryKey/en-US.ftl index 1c61a051f21..9b933c0fc3f 100644 --- a/packages/fxa-settings/src/components/UnitRowRecoveryKey/en-US.ftl +++ b/packages/fxa-settings/src/components/UnitRowRecoveryKey/en-US.ftl @@ -11,7 +11,7 @@ rk-cannot-remove-key = Your account recovery key could not be removed. rk-refresh-key = Refresh recovery key rk-content-explain = Restore your information when you forget your password. rk-content-reset-data = Why does resetting my password reset my data? -rk-cannot-verify-session-3 = Sorry, there was a problem verifying your session +rk-cannot-verify-session-4 = Sorry, there was a problem confirming your session rk-remove-modal-heading = Remove recovery key? rk-remove-modal-content = In the event you reset your password, you won’t be able to use your recovery key to access your data. You can’t undo this action. diff --git a/packages/fxa-settings/src/components/UnitRowRecoveryKey/index.tsx b/packages/fxa-settings/src/components/UnitRowRecoveryKey/index.tsx index 342f97e35ad..5c54b23cc20 100644 --- a/packages/fxa-settings/src/components/UnitRowRecoveryKey/index.tsx +++ b/packages/fxa-settings/src/components/UnitRowRecoveryKey/index.tsx @@ -111,9 +111,9 @@ export const UnitRowRecoveryKey = () => { hideModal(); alertBar.error( l10n.getString( - 'rk-cannot-verify-session-3', + 'rk-cannot-verify-session-4', null, - 'Sorry, there was a problem verifying your session' + 'Sorry, there was a problem confirming your session' ), error ); diff --git a/packages/fxa-settings/src/components/UnitRowSecondaryEmail/en-US.ftl b/packages/fxa-settings/src/components/UnitRowSecondaryEmail/en-US.ftl index c3ef9dd8a61..108e8aa715e 100644 --- a/packages/fxa-settings/src/components/UnitRowSecondaryEmail/en-US.ftl +++ b/packages/fxa-settings/src/components/UnitRowSecondaryEmail/en-US.ftl @@ -3,7 +3,7 @@ se-heading = Secondary email .header = Secondary email se-cannot-refresh-email = Sorry, there was a problem refreshing that email. -se-cannot-resend-code-2 = Sorry, there was a problem re-sending the verification code +se-cannot-resend-code-3 = Sorry, there was a problem re-sending the confirmation code # This string is used in a notification message near the top of the page. # Variables: # $email (String) - the user's email address, which does not need translation. @@ -14,16 +14,16 @@ se-set-primary-error-2 = Sorry, there was a problem changing your primary email # $email (String) - the user's email address, which does not need translation. se-delete-email-successful-2 = { $email } successfully deleted se-delete-email-error-2 = Sorry, there was a problem deleting this email -se-verify-session-2 = You’ll need to verify your current session to perform this action -se-verify-session-error-2 = Sorry, there was a problem verifying your session +se-verify-session-3 = You’ll need to confirm your current session to perform this action +se-verify-session-error-3 = Sorry, there was a problem confirming your session # Button to remove the secondary email se-remove-email = .title = Remove email # Button to refresh secondary email status se-refresh-email = .title = Refresh email -se-unverified = unverified -se-resend-code = Verification needed. +se-unverified-2 = unconfirmed +se-resend-code-2 = Confirmation needed. if it’s not in your inbox or spam folder. # Button to make secondary email the primary se-make-primary = Make primary diff --git a/packages/fxa-settings/src/components/UnitRowSecondaryEmail/index.tsx b/packages/fxa-settings/src/components/UnitRowSecondaryEmail/index.tsx index b1a5dcb81d0..efed6f49644 100644 --- a/packages/fxa-settings/src/components/UnitRowSecondaryEmail/index.tsx +++ b/packages/fxa-settings/src/components/UnitRowSecondaryEmail/index.tsx @@ -37,9 +37,9 @@ export const UnitRowSecondaryEmail = () => { } catch (e) { alertBar.error( l10n.getString( - 'se-cannot-resend-code-2', + 'se-cannot-resend-code-3', null, - 'Sorry, there was a problem re-sending the verification code' + 'Sorry, there was a problem re-sending the confirmation code' ) ); } @@ -103,9 +103,9 @@ export const UnitRowSecondaryEmail = () => { setQueuedAction(undefined); alertBar.info( l10n.getString( - 'se-verify-session-2', + 'se-verify-session-3', null, - "You'll need to verify your current session to perform this action" + "You'll need to confirm your current session to perform this action" ) ); }} @@ -113,9 +113,9 @@ export const UnitRowSecondaryEmail = () => { setQueuedAction(undefined); alertBar.error( l10n.getString( - 'se-verify-session-error-2', + 'se-verify-session-error-3', null, - 'Sorry, there was a problem verifying your session' + 'Sorry, there was a problem confirming your session' ), error ); @@ -202,19 +202,19 @@ export const UnitRowSecondaryEmail = () => { {!verified && ( - + - unverified + unconfirmed )}

    {!verified && ( { }} >

    - Verification needed.{' '} + Confirmation needed.{' '} {' '} if it's not in your inbox or spam folder.

    diff --git a/packages/fxa-settings/src/components/UnitRowTwoStepAuth/en-US.ftl b/packages/fxa-settings/src/components/UnitRowTwoStepAuth/en-US.ftl index 28b32ad41b1..852bb64e356 100644 --- a/packages/fxa-settings/src/components/UnitRowTwoStepAuth/en-US.ftl +++ b/packages/fxa-settings/src/components/UnitRowTwoStepAuth/en-US.ftl @@ -13,7 +13,7 @@ tfa-row-cannot-refresh = Sorry, there was a problem refreshing two-step authentication. tfa-row-content-explain = Prevent someone else from logging in by requiring a unique code only you have access to. -tfa-row-cannot-verify-session-3 = Sorry, there was a problem verifying your session +tfa-row-cannot-verify-session-4 = Sorry, there was a problem confirming your session tfa-row-disable-modal-heading = Disable two-step authentication? tfa-row-disable-modal-confirm = Disable diff --git a/packages/fxa-settings/src/components/UnitRowTwoStepAuth/index.tsx b/packages/fxa-settings/src/components/UnitRowTwoStepAuth/index.tsx index c6d842e437d..4001c7b2edf 100644 --- a/packages/fxa-settings/src/components/UnitRowTwoStepAuth/index.tsx +++ b/packages/fxa-settings/src/components/UnitRowTwoStepAuth/index.tsx @@ -182,9 +182,9 @@ export const UnitRowTwoStepAuth = () => { hideModal(); alertBar.error( l10n.getString( - 'tfa-row-cannot-verify-session-3', + 'tfa-row-cannot-verify-session-4', null, - 'Sorry, there was a problem verifying your session' + 'Sorry, there was a problem confirming your session' ), error ); diff --git a/packages/fxa-settings/src/lib/auth-errors/auth-errors.test.ts b/packages/fxa-settings/src/lib/auth-errors/auth-errors.test.ts new file mode 100644 index 00000000000..bc5b07a2595 --- /dev/null +++ b/packages/fxa-settings/src/lib/auth-errors/auth-errors.test.ts @@ -0,0 +1,84 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +import { + composeAuthUiErrorTranslationID, + AuthUiErrorNos, + AuthUiError, +} from './auth-errors'; +import * as Sentry from '@sentry/browser'; + +const notAnExistingErrorNumber = 100000; +const errorWithNoErrorNumber = { + message: "I'm an error with no error number!", +} as AuthUiError; +const errorWithAnInvalidErrorNumber = { + errno: notAnExistingErrorNumber, + message: 'This is an error with an invalid errno!', +} as AuthUiError; + +jest.mock('@sentry/browser', () => ({ + captureMessage: jest.fn(), +})); + +describe('composeAuthUIErrorTranslationId', () => { + it('logs an informative error to sentry if passed an error with no errno', () => { + composeAuthUiErrorTranslationID(errorWithNoErrorNumber); + const errorMessage = `composeAuthUiErrorTranslationId: No error number given, unable to create a localization ID for AuthUiError string. error: ${JSON.stringify( + errorWithNoErrorNumber + )}`; + expect(Sentry.captureMessage).toHaveBeenCalledWith(errorMessage); + }); + + it('logs an informative error to sentry if passed an error which does not match an entry in the AuthUiErrors object', () => { + composeAuthUiErrorTranslationID(errorWithAnInvalidErrorNumber); + const errorMessage = `composeAuthUiErrorTranslationId: There is no matching error in AuthUiErrors. error: ${JSON.stringify( + errorWithAnInvalidErrorNumber + )}`; + expect(Sentry.captureMessage).toHaveBeenCalledWith(errorMessage); + }); + + it('returns an empty string if passed no error number', () => { + expect(composeAuthUiErrorTranslationID(errorWithNoErrorNumber)).toEqual(''); + }); + + it('returns an empty string when given an error number with no corresponding error in the AuthUiError object', () => { + // First we just check that this has not become a valid AuthUiError number, for the sake of future clarity. + expect(AuthUiErrorNos[notAnExistingErrorNumber]).toBeUndefined(); + // Then we actually test the behavior. + expect( + composeAuthUiErrorTranslationID(errorWithAnInvalidErrorNumber) + ).toEqual(''); + }); + + it('correctly forms and returns a translation id for an auth ui error string which has never been updated (has no version number)', () => { + const validErrorNo = 106; + // First we just make sure that this is still a valid UI error. + expect(AuthUiErrorNos[validErrorNo]).toBeDefined(); + // Then we make sure that it doesn't have a version number. This is a safeguard against the test unknowingly being outdated. + expect(AuthUiErrorNos[validErrorNo].version).toBeUndefined(); + // The we actually test the functionality. + const expectedStringId = 'auth-error-106'; + const stringId = composeAuthUiErrorTranslationID({ + message: 'I am a valid error with a valid error number', + errno: validErrorNo, + }); + expect(stringId).toEqual(expectedStringId); + }); + + it('correctly forms and returns a translation id for an auth ui error string which HAS been updated (has a version number', () => { + const errnoWithVersion = 105; + // First we just make sure that this is still a valid UI error. + expect(AuthUiErrorNos[errnoWithVersion]).toBeDefined(); + // Then we make sure that it has a version number. This is a safeguard against the test unknowingly being outdated. + expect(AuthUiErrorNos[errnoWithVersion].version).toBeDefined(); + // The we actually test the functionality. + const expectedStringId = `auth-error-105-${AuthUiErrorNos[errnoWithVersion].version}`; + const stringId = composeAuthUiErrorTranslationID({ + message: 'This is a valid error, with a string that has a version number', + errno: errnoWithVersion, + }); + expect(stringId).toEqual(expectedStringId); + }); +}); diff --git a/packages/fxa-settings/src/lib/auth-errors/auth-errors.ts b/packages/fxa-settings/src/lib/auth-errors/auth-errors.ts index 1607e36826b..8042bce23e7 100644 --- a/packages/fxa-settings/src/lib/auth-errors/auth-errors.ts +++ b/packages/fxa-settings/src/lib/auth-errors/auth-errors.ts @@ -3,13 +3,17 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import { AuthServerError } from 'fxa-auth-client/browser'; +import * as Sentry from '@sentry/browser'; -export type AuthUiError = AuthServerError; +export type AuthUiError = AuthServerError & { version?: number }; const UNEXPECTED_ERROR_MESSAGE = 'Unexpected error'; const EXPIRED_VERIFICATION_ERROR_MESSAGE = - 'The link you clicked to verify your email is expired.'; + 'The link you clicked to confirm your email is expired.'; +const REUSED_SINGLE_USE_CONFIRMATION_CODE_ERROR_MESSAGE = + 'That confirmation link was already used, and can only be used once.'; +// We add a `version` value onto the errors for translations. This allows us to signal to translators (via the string ID) that a string has been updated. const ERRORS = { UNEXPECTED_ERROR: { errno: 999, @@ -45,11 +49,13 @@ const ERRORS = { }, UNVERIFIED_ACCOUNT: { errno: 104, - message: 'Unverified account', + message: 'Unconfirmed account', + version: 2, }, INVALID_VERIFICATION_CODE: { errno: 105, - message: 'Invalid verification code', + message: 'Invalid confirmation code', + version: 2, }, INVALID_JSON: { errno: 106, @@ -135,11 +141,13 @@ const ERRORS = { }, EMAIL_EXISTS: { errno: 136, - message: 'This email was already verified by another user', + message: 'This email was already confirmed by another user', + version: 2, }, UNVERIFIED_SESSION: { errno: 138, - message: 'Unverified session', + message: 'Unconfirmed session', + version: 2, }, EMAIL_PRIMARY_EXISTS: { errno: 139, @@ -179,7 +187,8 @@ const ERRORS = { }, CHANGE_EMAIL_TO_UNVERIFIED_EMAIL: { errno: 147, - message: 'Can not change primary email to an unverified email', + message: 'Can not change primary email to an unconfirmed email', + version: 2, }, CHANGE_EMAIL_TO_UNOWNED_EMAIL: { errno: 148, @@ -205,7 +214,8 @@ const ERRORS = { }, EXPIRED_TOKEN_VERIFICATION_CODE: { errno: 153, - message: 'This verification code has expired', + message: 'This confirmation code has expired', + version: 2, }, TOTP_TOKEN_EXISTS: { errno: 154, @@ -271,7 +281,8 @@ const ERRORS = { }, INVALID_EXPIRED_SIGNUP_CODE: { errno: 183, - message: 'Invalid or expired verification code', + message: 'Invalid or expired confirmation code', + version: 2, }, SERVER_BUSY: { errno: 201, @@ -373,7 +384,8 @@ const ERRORS = { }, SIGNUP_EMAIL_BOUNCE: { errno: 1018, - message: 'Your verification email was just returned. Mistyped email?', + message: 'Your confirmation email was just returned. Mistyped email?', + version: 2, }, DIFFERENT_EMAIL_REQUIRED: { errno: 1019, @@ -406,10 +418,12 @@ const ERRORS = { EXPIRED_VERIFICATION_LINK: { errno: 1025, message: EXPIRED_VERIFICATION_ERROR_MESSAGE, + version: 2, }, DAMAGED_VERIFICATION_LINK: { errno: 1026, - message: 'Verification link damaged', + message: 'Confirmation link damaged', + version: 2, }, UNEXPECTED_POSTMESSAGE_ORIGIN: { errno: 1027, @@ -479,11 +493,12 @@ const ERRORS = { UNKNOWN_ACCOUNT_VERIFICATION: { errno: 1040, message: EXPIRED_VERIFICATION_ERROR_MESSAGE, + version: 2, }, REUSED_SIGNIN_VERIFICATION_CODE: { errno: 1041, - message: - 'That confirmation link was already used, and can only be used once.', + message: REUSED_SINGLE_USE_CONFIRMATION_CODE_ERROR_MESSAGE, + version: 2, }, INPUT_REQUIRED: { errno: 1042, @@ -540,8 +555,8 @@ const ERRORS = { }, REUSED_PRIMARY_EMAIL_VERIFICATION_CODE: { errno: 1052, - message: - 'That confirmation link was already used, and can only be used once.', + message: REUSED_SINGLE_USE_CONFIRMATION_CODE_ERROR_MESSAGE, + version: 2, }, TOTP_CODE_REQUIRED: { errno: 1053, @@ -573,7 +588,8 @@ const ERRORS = { }, OTP_CODE_REQUIRED: { errno: 1060, - message: 'Please enter verification code', + message: 'Please enter confirmation code', + version: 2, }, /* Removed in https://github.com/mozilla/fxa/pull/1242 @@ -604,13 +620,41 @@ const ERRORS = { }; type ErrorKey = keyof typeof ERRORS; -type ErrorVal = { errno: number; message: string }; +type ErrorVal = { errno: number; message: string; version?: number }; + +export const composeAuthUiErrorTranslationID = (err: { + errno?: number; + message: string; +}) => { + /* all of these checks for fields/values being present look a little wonky, but allow us to work with + * the AuthUiError type, which has all optional fields. Previously this wasn't an issue bc we didn't use + * a utility. + */ + if (err.errno && err.errno in AuthUiErrorNos) { + const error = AuthUiErrorNos[err.errno]; + return `auth-error-${err.errno}${error.version ? '-' + error.version : ''}`; + } + /* + * We opt to return an empty string instead of throwing an error so that this can't break in prod. + * Instead, we log to sentry. + */ + const logMessage = err.errno + ? `composeAuthUiErrorTranslationID: There is no matching error in AuthUiErrors. error: ${JSON.stringify( + err + )}` + : `composeAuthUiErrorTranslationID: No error number given, unable to create a localization ID for AuthUiError string. error: ${JSON.stringify( + err + )}`; + Sentry.captureMessage(logMessage); + return ''; +}; export const AuthUiErrors: { [key in ErrorKey]: AuthUiError } = ( Object.entries(ERRORS) as [[ErrorKey, ErrorVal]] ).reduce((acc: { [key in ErrorKey]: AuthUiError }, [k, v]) => { const e = new Error(v.message) as AuthUiError; e.errno = v.errno; + e.version = v.version; acc[k] = e; return acc; }, {} as Record); @@ -621,6 +665,7 @@ export const AuthUiErrorNos: { (acc: { [key: number]: AuthUiError }, [k, v]) => { const e = new Error(v.message) as AuthUiError; e.errno = v.errno; + e.version = v.version; acc[e.errno] = e; return acc; }, diff --git a/packages/fxa-settings/src/lib/auth-errors/en-US.ftl b/packages/fxa-settings/src/lib/auth-errors/en-US.ftl index f632ce49783..c7ac5480658 100644 --- a/packages/fxa-settings/src/lib/auth-errors/en-US.ftl +++ b/packages/fxa-settings/src/lib/auth-errors/en-US.ftl @@ -2,7 +2,7 @@ auth-error-102 = Unknown account auth-error-103 = Incorrect password -auth-error-105 = Invalid verification code +auth-error-105-2 = Invalid confirmation code auth-error-110 = Invalid token # This string is the amount of time required before a user can attempt another request. # Variables: @@ -12,8 +12,8 @@ auth-error-110 = Invalid token # as part of the string. # (for example: "in 15 minutes") auth-error-114 = You’ve tried too many times. Please try again { $retryAfter }. -auth-error-138 = Unverified session +auth-error-138-2 = Unconfirmed session auth-error-139 = Secondary email must be different than your account email auth-error-155 = TOTP token not found -auth-error-183 = Invalid or expired verification code +auth-error-183-2 = Invalid or expired confirmation code auth-error-1008 = Your new password must be different diff --git a/packages/fxa-shared/guards/AdminPanelGuard.ts b/packages/fxa-shared/guards/AdminPanelGuard.ts index 0ee461b6ed6..538a19e7548 100644 --- a/packages/fxa-shared/guards/AdminPanelGuard.ts +++ b/packages/fxa-shared/guards/AdminPanelGuard.ts @@ -112,7 +112,7 @@ const defaultAdminPanelPermissions: Permissions = { level: PermissionLevel.Admin, }, [AdminPanelFeature.UnverifyEmail]: { - name: 'Unverify Email Address', + name: 'Unconfirm Email Address', level: PermissionLevel.Admin, }, [AdminPanelFeature.UnlinkAccount]: { diff --git a/packages/fxa-support-panel/views/index.hbs b/packages/fxa-support-panel/views/index.hbs index 26c89567999..d49926536e1 100644 --- a/packages/fxa-support-panel/views/index.hbs +++ b/packages/fxa-support-panel/views/index.hbs @@ -12,7 +12,7 @@ {{email}} - Email verified: + Email confirmed: {{#emailVerified}}yes{{/emailVerified}} {{^emailVerified}}no{{/emailVerified}}