Skip to content

Wire functionality to remove a recovery phone#18247

Merged
vbudhram merged 1 commit intomainfrom
fxa-10373
Jan 25, 2025
Merged

Wire functionality to remove a recovery phone#18247
vbudhram merged 1 commit intomainfrom
fxa-10373

Conversation

@vbudhram
Copy link
Copy Markdown
Contributor

Because

  • Users should be able to remove the recovery phone

This pull request

  • Adds the ability to remove recovery phone
  • Users must have a backup authentication codes in order to remove
  • Adds auth errors to front end for localization

Issue that this pull request solves

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

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).

Other information (Optional)

Any other information that is important to this pull request.

@vbudhram vbudhram self-assigned this Jan 17, 2025
@vbudhram vbudhram marked this pull request as ready for review January 22, 2025 18:32
@vbudhram vbudhram requested review from a team as code owners January 22, 2025 18:32
Comment thread packages/fxa-settings/src/components/Settings/PageRecoveryPhoneRemove/en.ftl Outdated
@vbudhram vbudhram requested a review from bcolsson January 23, 2025 17:18
Comment thread packages/fxa-settings/src/components/Settings/PageRecoveryPhoneRemove/en.ftl Outdated
Comment thread packages/fxa-settings/src/components/Settings/PageRecoveryPhoneRemove/en.ftl Outdated
Comment thread packages/fxa-settings/src/components/Banner/index.tsx

// TODO, actually get this number back and format it
const formattedFullPhoneNumber = '+1 (555) 555-5555';
const formattedFullPhoneNumber = '+1 ••• ••••';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think auth client supports fetching this value? Is there a reason not to do this here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was hoping to rebase on Lauren PR, but I can do as follow up in #18287 too.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we want the full number here instead of just last four digits (based on Figma), so that might be a separate request? I'm still on the fence about this. Kinda feel like we could display the whole number all the time in Settings when the session is 2FA verified.

Copy link
Copy Markdown
Contributor

@LZoog LZoog Jan 24, 2025

Choose a reason for hiding this comment

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

@vbudhram I can fix this in my PR since I have some similar fixes. I'm going to have merge conflicts with your GQL recovery phone update that's in the demo branch, so I'll rebase after this lands and get it sorted.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just a heads up I'm updating this in my branch, but I'm just going to just display the unformatted phone number. I'm going to file a follow up issue from my PR around what we get back when the session isn't verified + that national_format bit so it should get taken care of there.

Comment thread packages/fxa-shared/lib/errors.ts Outdated
Comment thread packages/fxa-auth-server/lib/error.js Outdated
Comment thread packages/fxa-settings/src/components/Settings/index.tsx Outdated
@vbudhram vbudhram force-pushed the fxa-10373 branch 3 times, most recently from a6310ff to d8d0432 Compare January 24, 2025 21:14
Copy link
Copy Markdown
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.

Noted a few comments. Might be good to update some before merge, but I won't block on them because we have opportunities to adjust in a few other PRs including the other one you have in flight.

Comment thread packages/fxa-settings/src/components/Banner/index.tsx
Comment thread packages/fxa-settings/src/components/Banner/index.stories.tsx
Comment thread packages/fxa-settings/src/components/Settings/PageRecoveryPhoneRemove/en.ftl Outdated
const user = userEvent.setup();
await act(async () => {
await user.click(screen.getByRole('link', { name: 'Cancel' }));
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

missing assertion to verify what happens after clicking?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure how to test this since page navigates with

<Link className="link-blue text-sm" to={SETTINGS_PATH}>
  Cancel
</Link>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see, might better suited for a functional test then!


// TODO, actually get this number back and format it
const formattedFullPhoneNumber = '+1 (555) 555-5555';
const formattedFullPhoneNumber = '+1 ••• ••••';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we want the full number here instead of just last four digits (based on Figma), so that might be a separate request? I'm still on the fence about this. Kinda feel like we could display the whole number all the time in Settings when the session is 2FA verified.

Comment thread packages/fxa-settings/src/components/Settings/PageRecoveryPhoneRemove/index.tsx Outdated
Comment thread packages/fxa-settings/src/components/Settings/index.tsx Outdated
Comment thread packages/fxa-settings/src/lib/auth-errors/auth-errors.ts Outdated
Comment thread packages/fxa-settings/src/models/Account.ts
@vbudhram vbudhram merged commit 4bb97b4 into main Jan 25, 2025
@vbudhram vbudhram deleted the fxa-10373 branch January 25, 2025 13:11
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.

5 participants