Skip to content

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

Merged
merged 4 commits into from
Oct 24, 2019

Conversation

bojeil-google
Copy link
Contributor

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.

… GetAccountInfo server response.

First step in supporting multi-factor authentication with SMS as a second factor.
Copy link
Contributor

@hiranya911 hiranya911 left a 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:

  1. Embed Mfa and Metadata types directly into GetAccountInfoUserResponse and remove them.
  2. Rename MfaInfo to AuthFactorInfo.
  3. Rename MultiFactorInfo to AuthFactor and PhoneMultiFactorInfo to just PhoneFactor.

Copy link
Contributor Author

@bojeil-google bojeil-google left a 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.

Copy link
Contributor

@hiranya911 hiranya911 left a 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) {
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 check response before passing it to getFactorId()?

Copy link
Contributor Author

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.

@bojeil-google bojeil-google merged commit fa7f2ec into auth-mfa Oct 24, 2019
@bojeil-google bojeil-google deleted the auth-mfa-temp branch November 9, 2019 04:42
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.

2 participants