Skip to content

Commit 20c070c

Browse files
authored
Merge pull request #19434 from mozilla/FXA-12382
cleanup(2fa): Remove feature flag on redesigned password reset flow with SMS
2 parents 393cb19 + 576acf3 commit 20c070c

9 files changed

Lines changed: 21 additions & 47 deletions

File tree

packages/functional-tests/tests/resetPassword/resetPassword2FA.spec.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,6 @@ test.describe('reset password with recovery phone', () => {
313313
target.smsClient.guardTestPhoneNumber();
314314
});
315315

316-
test.beforeEach(async ({ pages: { configPage } }) => {
317-
// Ensure that the feature flag is enabled
318-
const config = await configPage.getConfig();
319-
test.skip(config.featureFlags.recoveryPhonePasswordReset2fa !== true);
320-
});
321-
322316
test('can reset password with 2FA enabled using recovery phone', async ({
323317
page,
324318
target,

packages/fxa-content-server/server/config/local.json-dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
"featureFlags": {
7575
"sendFxAStatusOnSettings": true,
7676
"recoveryCodeSetupOnSyncSignIn": true,
77-
"recoveryPhonePasswordReset2fa": true,
7877
"updatedInlineTotpSetupFlow": true,
7978
"updatedInlineRecoverySetupFlow": true,
8079
"showLocaleToggle": true,

packages/fxa-content-server/server/lib/beta-settings.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ const settingsConfig = {
118118
recoveryCodeSetupOnSyncSignIn: config.get(
119119
'featureFlags.recoveryCodeSetupOnSyncSignIn'
120120
),
121-
recoveryPhonePasswordReset2fa: config.get(
122-
'featureFlags.recoveryPhonePasswordReset2fa'
123-
),
124121
updatedInlineTotpSetupFlow: config.get(
125122
'featureFlags.updatedInlineTotpSetupFlow'
126123
),

packages/fxa-content-server/server/lib/configuration.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,6 @@ const conf = (module.exports = convict({
241241
format: Boolean,
242242
env: 'FEATURE_FLAGS_RECOVERY_CODE_SETUP_ON_SYNC_SIGN_IN',
243243
},
244-
recoveryPhonePasswordReset2fa: {
245-
default: false,
246-
doc: 'Enables recovery phone codes for 2FA in password reset',
247-
format: Boolean,
248-
env: 'FEATURE_FLAGS_RECOVERY_PHONE_PASSWORD_RESET_2FA',
249-
},
250244
updatedInlineTotpSetupFlow: {
251245
default: false,
252246
doc: 'Enables a redesign of the inline TOTP setup',

packages/fxa-content-server/server/lib/routes/react-app/route-definition-index.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ function getIndexRouteDefinition(config) {
5555
const FEATURE_FLAGS_RECOVERY_CODE_SETUP_ON_SYNC_SIGN_IN = config.get(
5656
'featureFlags.recoveryCodeSetupOnSyncSignIn'
5757
);
58-
const FEATURE_FLAGS_RECOVERY_PHONE_PASSWORD_RESET_2FA = config.get(
59-
'featureFlags.recoveryPhonePasswordReset2fa'
60-
);
6158
const FEATURE_FLAGS_UPDATED_2FA_SETUP_FLOW = config.get(
6259
'featureFlags.updated2faSetupFlow'
6360
);
@@ -129,8 +126,6 @@ function getIndexRouteDefinition(config) {
129126
sendFxAStatusOnSettings: FEATURE_FLAGS_FXA_STATUS_ON_SETTINGS,
130127
recoveryCodeSetupOnSyncSignIn:
131128
FEATURE_FLAGS_RECOVERY_CODE_SETUP_ON_SYNC_SIGN_IN,
132-
recoveryPhonePasswordReset2fa:
133-
FEATURE_FLAGS_RECOVERY_PHONE_PASSWORD_RESET_2FA,
134129
updated2faSetupFlow: FEATURE_FLAGS_UPDATED_2FA_SETUP_FLOW,
135130
updatedInlineRecoverySetupFlow:
136131
FEATURE_FLAGS_UPDATED_INLINE_RECOVERY_SETUP_FLOW,

packages/fxa-settings/src/lib/config.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export interface Config {
4848
};
4949
paymentsNext: {
5050
url: string;
51-
}
51+
};
5252
};
5353
oauth: {
5454
clientId: string;
@@ -100,7 +100,6 @@ export interface Config {
100100
featureFlags?: {
101101
keyStretchV2?: boolean;
102102
recoveryCodeSetupOnSyncSignIn?: boolean;
103-
recoveryPhonePasswordReset2fa?: boolean;
104103
updatedInlineTotpSetupFlow?: boolean;
105104
updated2faSetupFlow?: boolean;
106105
updatedInlineRecoverySetupFlow?: boolean;
@@ -151,8 +150,8 @@ export function getDefault() {
151150
url: '',
152151
},
153152
paymentsNext: {
154-
url: ''
155-
}
153+
url: '',
154+
},
156155
},
157156
oauth: {
158157
clientId: '',
@@ -196,7 +195,6 @@ export function getDefault() {
196195
},
197196
featureFlags: {
198197
recoveryCodeSetupOnSyncSignIn: false,
199-
recoveryPhonePasswordReset2fa: false,
200198
updatedInlineTotpSetupFlow: false,
201199
updated2faSetupFlow: false,
202200
updatedInlineRecoverySetupFlow: false,

packages/fxa-settings/src/pages/ResetPassword/ConfirmTotpResetPassword/container.test.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ jest.mock('../../../models', () => ({
1717
__esModule: true,
1818
useAuthClient: () => ({
1919
checkTotpTokenCodeWithPasswordForgotToken: mockCheckTotp,
20-
recoveryPhoneGetWithPasswordForgotToken: mockRecoveryPhoneGetWithPasswordForgotToken,
20+
recoveryPhoneGetWithPasswordForgotToken:
21+
mockRecoveryPhoneGetWithPasswordForgotToken,
2122
}),
2223
useFtlMsgResolver: () => ({
2324
getMsg: (_id: string, fallback: string) => fallback,
2425
}),
25-
useConfig: () => ({
26-
featureFlags: { recoveryPhonePasswordReset2fa: true },
27-
}),
2826
}));
2927

3028
const mockNavigate = jest.fn();
@@ -77,7 +75,9 @@ describe('ConfirmTotpResetPasswordContainer', () => {
7775

7876
it('calls authClient then navigates on success', async () => {
7977
mockCheckTotp.mockResolvedValueOnce({ success: true });
80-
mockRecoveryPhoneGetWithPasswordForgotToken.mockResolvedValueOnce({ exists: false });
78+
mockRecoveryPhoneGetWithPasswordForgotToken.mockResolvedValueOnce({
79+
exists: false,
80+
});
8181

8282
await renderComponent();
8383

@@ -102,7 +102,9 @@ describe('ConfirmTotpResetPasswordContainer', () => {
102102

103103
it('sets localized error message when authClient returns success: false', async () => {
104104
mockCheckTotp.mockResolvedValueOnce({ success: false });
105-
mockRecoveryPhoneGetWithPasswordForgotToken.mockResolvedValueOnce({ exists: false });
105+
mockRecoveryPhoneGetWithPasswordForgotToken.mockResolvedValueOnce({
106+
exists: false,
107+
});
106108

107109
await renderComponent();
108110

@@ -115,7 +117,9 @@ describe('ConfirmTotpResetPasswordContainer', () => {
115117

116118
it('forwards location.state when onTroubleWithCode is invoked', async () => {
117119
mockCheckTotp.mockResolvedValueOnce({ success: true });
118-
mockRecoveryPhoneGetWithPasswordForgotToken.mockResolvedValueOnce({ exists: true });
120+
mockRecoveryPhoneGetWithPasswordForgotToken.mockResolvedValueOnce({
121+
exists: true,
122+
});
119123

120124
await renderComponent();
121125

packages/fxa-settings/src/pages/ResetPassword/ConfirmTotpResetPassword/container.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44

55
import React, { useState } from 'react';
66
import { RouteComponentProps, useLocation } from '@reach/router';
7-
import { useAuthClient, useFtlMsgResolver, useConfig } from '../../../models';
7+
import { useAuthClient, useFtlMsgResolver } from '../../../models';
88
import ConfirmTotpResetPassword from '.';
99
import { useNavigateWithQuery } from '../../../lib/hooks/useNavigateWithQuery';
1010
import { CompleteResetPasswordLocationState } from '../CompleteResetPassword/interfaces';
1111
import { getLocalizedErrorMessage } from '../../../lib/error-utils';
1212
import { AuthUiErrors } from '../../../lib/auth-errors/auth-errors';
1313

1414
const ConfirmTotpResetPasswordContainer = (_: RouteComponentProps) => {
15-
const config = useConfig();
1615
const authClient = useAuthClient();
1716
const location = useLocation();
1817
const {
@@ -68,13 +67,7 @@ const ConfirmTotpResetPasswordContainer = (_: RouteComponentProps) => {
6867
};
6968

7069
const onTroubleWithCode = async () => {
71-
let nextRoute = '/confirm_backup_code_reset_password';
72-
73-
const { exists } = await authClient.recoveryPhoneGetWithPasswordForgotToken(token);
74-
75-
if (config.featureFlags?.recoveryPhonePasswordReset2fa && exists) {
76-
nextRoute = '/reset_password_totp_recovery_choice';
77-
}
70+
const nextRoute = '/reset_password_totp_recovery_choice';
7871

7972
navigateWithQuery(nextRoute, {
8073
state: {

packages/fxa-settings/src/pages/ResetPassword/ResetPasswordRecoveryPhone/container.test.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@ jest.mock('../../../models', () => ({
1919
useAuthClient: () => ({
2020
recoveryPhoneResetPasswordConfirm: mockRecoveryPhoneResetPasswordConfirm,
2121
recoveryPhonePasswordResetSendCode: mockRecoveryPhonePasswordResetSendCode,
22-
recoveryPhoneGetWithPasswordForgotToken: mockRecoveryPhoneGetWithPasswordForgotToken,
22+
recoveryPhoneGetWithPasswordForgotToken:
23+
mockRecoveryPhoneGetWithPasswordForgotToken,
2324
}),
2425
useFtlMsgResolver: () => ({
2526
getMsg: (_id: string, fallback: string) => fallback,
2627
}),
27-
useConfig: () => ({
28-
featureFlags: { recoveryPhonePasswordReset2fa: true },
29-
}),
3028
}));
3129

3230
const mockNavigate = jest.fn();
@@ -77,7 +75,9 @@ describe('ResetPasswordRecoveryPhoneContainer', () => {
7775
});
7876

7977
it('calls authClient then navigates on success', async () => {
80-
mockRecoveryPhoneResetPasswordConfirm.mockResolvedValueOnce({ success: true });
78+
mockRecoveryPhoneResetPasswordConfirm.mockResolvedValueOnce({
79+
success: true,
80+
});
8181

8282
await renderComponent();
8383

0 commit comments

Comments
 (0)