Skip to content

feat(recovery): Add reset password recovery phone views and functionality#18929

Merged
vbudhram merged 1 commit intomainfrom
fxa-11510-v2
May 30, 2025
Merged

feat(recovery): Add reset password recovery phone views and functionality#18929
vbudhram merged 1 commit intomainfrom
fxa-11510-v2

Conversation

@vbudhram
Copy link
Contributor

@vbudhram vbudhram commented May 28, 2025

Because

  • Users should be able to use a recovery phone if they have 2FA enabled and are performing a password reset

This pull request

  • Adds phone-based password reset functionality for 2FA accounts
  • Adds functional test to reset password using a recovery phone
  • Updates auth-server to mark PasswordForgotToken 2FA verified upon verifying a recovery phone code
  • Adds automated Glean metrics for view, submit, and button clicks

Issue that this pull request solves

Closes: https://mozilla-hub.atlassian.net/browse/FXA-11510

Checklist

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).

Screenshots (Optional)

Please attach the screenshots of the changes made in case of change in user interface.

Other information (Optional)

Any other information that is important to this pull request.

@vbudhram vbudhram requested review from a team as code owners May 28, 2025 15:43
@vbudhram vbudhram changed the title feat(recovery): Add reset password recovery phone views and functiona… feat(recovery): Add reset password recovery phone views and functionality May 28, 2025
@vbudhram vbudhram self-assigned this May 28, 2025
Copy link
Contributor

@vpomerleau vpomerleau left a comment

Choose a reason for hiding this comment

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

Found a bug while testing locally. Will read through the rest of the code now and follow up with more comments if anything comes up!

screen.getByRole('link', {
name: 'Use backup authentication codes instead?',
})
).toHaveAttribute('href', '/reset_password_recovery_code');
Copy link
Contributor

@vpomerleau vpomerleau May 28, 2025

Choose a reason for hiding this comment

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

The actual path is /confirm_backup_code_reset_password (should be updated throughout 😄) (Though I do like the idea of having all reset password paths start with reset_password)

Copy link
Contributor

Choose a reason for hiding this comment

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

Also noticed that we should make sure that all the paths for 2FA in password reset are listed in content-server, otherwise reloading the urls leads to a Page not found error.

const FEATURE_FLAGS_RECOVERY_CODE_SETUP_ON_SYNC_SIGN_IN = config.get(
'featureFlags.recoveryCodeSetupOnSyncSignIn'
);
const FEATURE_FLAGS_RECOVERY_PHONE_RESET_PASSWORD_2FA = config.get(
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this match the variable name in configuration.js? There it is FEATURE_FLAGS_RECOVERY_PHONE_PASSWORD_RESET_2FA

@@ -0,0 +1,30 @@
## ResetPasswordRecoveryPhone page

reset-password-recovery-phone-flow-heading = Reset your password
Copy link
Contributor

Choose a reason for hiding this comment

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

Could use the existing password-reset-flow-heading id for this string, since it's shared across reset password pages.


await page.waitForURL(/reset_password_totp_recovery_choice/);

await signinRecoveryChoice.clickChoosePhone();
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add these to the resetPassword page model?

Copy link
Contributor

@vpomerleau vpomerleau left a comment

Choose a reason for hiding this comment

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

🚀

@vbudhram vbudhram merged commit 92d6cab into main May 30, 2025
20 checks passed
@vbudhram vbudhram deleted the fxa-11510-v2 branch May 30, 2025 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants