Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 418
Adds multi-factor support for updateUser#706
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -42,6 +42,14 @@ function parseDate(time: any): string { | ||
| return null; | ||
| } | ||
| interface SecondFactor { | ||
| uid: string; | ||
| phoneNumber: string; | ||
| displayName?: string; | ||
| enrollmentTime?: string; | ||
| factorId: string; | ||
| } | ||
| /** Parameters for update user operation */ | ||
| export interface UpdateRequest { | ||
| disabled?: boolean; | ||
| @@ -51,6 +59,9 @@ export interface UpdateRequest { | ||
| password?: string; | ||
| phoneNumber?: string | null; | ||
| photoURL?: string | null; | ||
| multiFactor?: { | ||
hiranya911 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| enrolledFactors: SecondFactor[] | null; | ||
| }; | ||
| } | ||
| /** Parameters for create user operation */ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -639,6 +639,16 @@ declare namespace admin.auth { | ||
| */ | ||
| tenantId?: string | null; | ||
| multiFactor?: { | ||
| enrolledFactors: Array<{ | ||
| uid: string; | ||
| phoneNumber: string; | ||
| displayName?: string; | ||
| enrollmentTime?: string; | ||
| factorId: string; | ||
| }>; | ||
| }; | ||
| /** | ||
| * @return A JSON-serializable representation of this object. | ||
| */ | ||
| @@ -685,6 +695,16 @@ declare namespace admin.auth { | ||
| * The user's photo URL. | ||
| */ | ||
| photoURL?: string | null; | ||
| multiFactor?: { | ||
| enrolledFactors: Array<{ | ||
| uid: string; | ||
| phoneNumber: string; | ||
| displayName?: string; | ||
| enrollmentTime?: string; | ||
| factorId: string; | ||
| }> | null; | ||
| }; | ||
| } | ||
| /** | ||
| @@ -1000,6 +1020,16 @@ declare namespace admin.auth { | ||
| * to the tenant corresponding to that `TenantAwareAuth` instance's tenant ID. | ||
| */ | ||
| tenantId?: string | null; | ||
| multiFactor?: { | ||
| enrolledFactors: Array<{ | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it make sense to reduce this duplication by introducing an interface? Like the ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I think we can define an interface for this. I can do it in the next PR. This is going to be modified and more documentation added later anyway. | ||
| uid: string; | ||
| phoneNumber: string; | ||
| displayName?: string; | ||
| enrollmentTime?: string; | ||
| factorId: string; | ||
| }>; | ||
| }; | ||
| } | ||
| /** | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
Perhaps this is slightly more clear:
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.
Hmm it is a bit more complicated as passing
request.mfa = {}will clear all existing second factors on the user.We should only pass that if the developers passing explicitly an empty array for
enrolledFactorsor null forenrolledFactors.