-
Notifications
You must be signed in to change notification settings - Fork 389
Populates UserRecord with multi-factor related info #681
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
Conversation
… GetAccountInfo server response. First step in supporting multi-factor authentication with SMS as a second factor.
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.
Looks pretty good. My main concerns are around some of the names. There are just many similar sounding names, and it makes it a little difficult to follow. My primary suggestions are:
- Embed
Mfa
andMetadata
types directly intoGetAccountInfoUserResponse
and remove them. - Rename
MfaInfo
toAuthFactorInfo
. - Rename
MultiFactorInfo
toAuthFactor
andPhoneMultiFactorInfo
to justPhoneFactor
.
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.
Thanks for the review and feedback. I made most of the requested changes except some of the public API renames as they have been approved by the API council and already implemented in the client SDKs (currently in alpha phase). It is hard to change it at this point across all platforms.
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.
LGTM with a question.
} else { | ||
private initFromServerResponse(response: AuthFactorInfo) { | ||
const factorId = this.getFactorId(response); | ||
if (!factorId || !response || !response.mfaEnrollmentId) { |
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.
Should we check response
before passing it to getFactorId()
?
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 have added a check for this. I also added a test when undefined is passed to the constructor that the expected error is caught and thrown.
Updates UserRecord to parse multi-factor related information from the GetAccountInfo server response.
First step in supporting multi-factor authentication with SMS as a second factor.