-
-
Notifications
You must be signed in to change notification settings - Fork 214
feat(gotrue): Add phone mfa enrollment #1188
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
base: main
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 15482416459Details
💛 - Coveralls |
/// TOTP enrollment information. | ||
final TOTPEnrollment totp; | ||
/// TOTP enrollment information (only present when type is totp). | ||
final TOTPEnrollment? totp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this isn't great, but I think we can call it that it's a fix. Open to suggestions to avoid this though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment in https://github.com/supabase/supabase-flutter/pull/1188/files#r2131807418
if (factorType == FactorType.totp) { | ||
body['issuer'] = issuer; | ||
} else if (factorType == FactorType.phone) { | ||
if (phone == null) { | ||
throw ArgumentError('Phone number is required for phone factor type'); | ||
} | ||
body['phone'] = phone; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets validate that an issuer needs to be provided for the totp
factor type also.
if (factorType == FactorType.totp) { | |
body['issuer'] = issuer; | |
} else if (factorType == FactorType.phone) { | |
if (phone == null) { | |
throw ArgumentError('Phone number is required for phone factor type'); | |
} | |
body['phone'] = phone; | |
} | |
if (factorType == FactorType.totp && issuer != null) { | |
body['issuer'] = issuer; | |
} else if (factorType == FactorType.phone && phone != null) { | |
body['phone'] = phone; | |
} else { | |
throw ArgumentError('Invalid arguments, expected an issuer for totp factor type or phone for phone factor. type'); | |
} |
What kind of change does this PR introduce?
feature of adding phone support for MFA enrollment
JS PR here: supabase/auth-js#932
What is the current behavior?
Enrolling in MFA via SMS is supported .
What is the new behavior?
SMS MFA is not supported.