Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions packages/functional-tests/tests/settings/changeEmail.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,21 +216,6 @@ test.describe('severity-1 #smoke', () => {
await settings.secondaryEmail.deleteButton.click();

await expect(settings.alertBar).toHaveText(/successfully deleted/);

await settings.secondaryEmail.addButton.click();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unconfirmed secondary emails will no longer be stored in the database, only temporarily in Redis --> if the setup is incomplete, there is no new "unconfirmed" entry in Settings.

await secondaryEmail.emailTextbox.fill(newEmail);
await secondaryEmail.submit();

// skip verification
await settings.goto();

await expect(settings.secondaryEmail.unverifiedText).toHaveText(
'unconfirmed'
);

await settings.secondaryEmail.deleteButton.click();

await expect(settings.alertBar).toHaveText(/successfully deleted/);
});
});
});
Expand Down Expand Up @@ -274,7 +259,7 @@ async function setNewPassword(
oldPassword: string,
newPassword: string,
target: BaseTarget,
email: string,
email: string
): Promise<void> {
await settings.password.changeButton.click();

Expand Down
9 changes: 7 additions & 2 deletions packages/fxa-auth-server/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,7 @@ const convictConf = convict({
subscriptionSupportUrl: {
doc: 'url to Mozilla subscription support page',
format: String,
default:
'https://support.mozilla.org/products',
default: 'https://support.mozilla.org/products',
},
redirectDomain: {
doc: 'Domain that mail urls are allowed to redirect to',
Expand Down Expand Up @@ -1749,6 +1748,12 @@ const convictConf = convict({
format: 'duration',
env: 'SECONDARY_EMAIL_MIN_UNVERIFIED_ACCOUNT_TIME',
},
pendingTtlSeconds: {
doc: 'TTL in seconds for pending secondary email reservations (Redis)',
format: 'nat',
default: 3600,
env: 'SECONDARY_EMAIL_PENDING_TTL_SECONDS',
},
},
signinCodeSize: {
doc: 'signinCode size in bytes',
Expand Down
12 changes: 10 additions & 2 deletions packages/fxa-auth-server/lib/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,7 @@ AppError.recoveryCodesAlreadyExist = () => {
code: 400,
error: 'Bad Request',
errno: ERRNO.RECOVERY_CODES_ALREADY_EXISTS,
message:
'Recovery codes or a verified TOTP token already exist',
message: 'Recovery codes or a verified TOTP token already exist',
});
};

Expand Down Expand Up @@ -810,6 +809,15 @@ AppError.emailExists = () => {
});
};

AppError.emailInUseByAnotherAccount = () => {
return new AppError({
code: 400,
error: 'Bad Request',
errno: ERRNO.EMAIL_IN_USE_BY_ANOTHER_ACCOUNT,
message: 'This email is already in use by another account.',
});
};

AppError.cannotDeletePrimaryEmail = () => {
return new AppError({
code: 400,
Expand Down
Loading