Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PER-9943-cant-delete-sms-mfa #503

Merged
merged 4 commits into from
Jan 13, 2025
Merged

Conversation

crisnicandrei
Copy link
Contributor

Handle 11 character phone numbers(with country code) in SMS MFA setup

Steps to test:

  1. Have an account with two factor auth using sms with county code
  2. Go to settings to disable the method
  3. Click the delete button next to the method
  4. The form should now work as before

Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 76.19048% with 5 lines in your changes missing coverage. Please review.

Project coverage is 43.28%. Comparing base (e2f6551) to head (241e1fb).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...nents/two-factor-auth/two-factor-auth.component.ts 76.19% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #503      +/-   ##
==========================================
+ Coverage   43.19%   43.28%   +0.09%     
==========================================
  Files         363      363              
  Lines       11104    11123      +19     
  Branches     1810     1818       +8     
==========================================
+ Hits         4796     4815      +19     
- Misses       6146     6148       +2     
+ Partials      162      160       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +70 to +76
const match = numbers.match(/^(\d{1,3})/);
if (match) {
countryCode = `+${match[1]}`;
numbers = numbers.substring(match[1].length);
}
Copy link
Member

Choose a reason for hiding this comment

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

Can you add coverage for these paths of code? The other ones have examples provided in the tests and it would be nice to see that spelled out for this branch as well.

@crisnicandrei
Copy link
Contributor Author

@meisekimiu you are right, test added :)

@crisnicandrei crisnicandrei requested a review from k8lyn6 January 8, 2025 15:32
Copy link

@k8lyn6 k8lyn6 left a comment

Choose a reason for hiding this comment

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

A few things:

  1. @meisekimiu I'm not entirely sure how to test the actual bug for this, because I no longer have an account set up with a SMS 2FA number with the country code. I'm also not able to set that up directly in the webapp because we don't allow country codes. Is there a way to do this in FusionAuth, that you're aware of?
  2. @crisnicandrei I did notice that when I try to add a new SMS 2FA method, I enter my phone number but the button to submit the form to request a code requires 13 characters before it becomes active. It should require only 10 numerical characters. This appears to be a new change as this is not the case on prod. This might solve the issue to point 1 above, though, if I am able to submit a phone number here that looks like #-###-###-####.

@crisnicandrei
Copy link
Contributor Author

@k8lyn6 I did not understand the last part. Should the button become active after 10 characters?

@k8lyn6
Copy link

k8lyn6 commented Jan 10, 2025

@crisnicandrei yes, US numbers are ten digits long (in the format XXX-XXX-XXXX). I'm not sure if you adjusted the form to allow for a few extra numbers, which I think is okay to solve the bug reported, but it should also be able to accept 10 digits. Sorry for the confusion!

@k8lyn6 k8lyn6 self-requested a review January 10, 2025 14:31
@crisnicandrei
Copy link
Contributor Author

@k8lyn6 It now allows 10 digit long numbers :)

@meisekimiu
Copy link
Member

  1. Is there a way to do this in FusionAuth, that you're aware of?

I'm not sure, but you might be able to override that as an admin in FusionAuth dev.

Copy link

@k8lyn6 k8lyn6 left a comment

Choose a reason for hiding this comment

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

The bug itself is proving challenging to QA test, because I'm not able to get my account into that state anymore and it's difficult to search for an account currently in that state. That being said, 2FA functionality seems to work as expected on this pull request, so I'm going to approve this.

@crisnicandrei crisnicandrei force-pushed the PER-9943-cant-delete-sms-mfa branch from 186a7a1 to 241e1fb Compare January 10, 2025 22:55
@crisnicandrei crisnicandrei merged commit d72935c into main Jan 13, 2025
4 checks passed
@crisnicandrei crisnicandrei deleted the PER-9943-cant-delete-sms-mfa branch January 13, 2025 09:41
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