Skip to content

Fix types for Create / Update MultifactorRequest #1268

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

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions src/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ export namespace auth {
* Interface representing common properties of a user enrolled second factor
* for an `UpdateRequest`.
*/
export interface UpdateMultiFactorInfoRequest {
export interface BaseUpdateMultiFactorInfoRequest {

/**
* The ID of the enrolled second factor. This ID is unique to the user. When not provided,
Expand Down Expand Up @@ -367,13 +367,21 @@ export namespace auth {
* Interface representing a phone specific user enrolled second factor
* for an `UpdateRequest`.
*/
export interface UpdatePhoneMultiFactorInfoRequest extends UpdateMultiFactorInfoRequest {
export interface UpdatePhoneMultiFactorInfoRequest extends BaseUpdateMultiFactorInfoRequest {

/**
* The phone number associated with a phone second factor.
*/
phoneNumber: string;
}

/**
* Interface representing properties of a user enrolled second factor
* for an `UpdateRequest`.
*/
export type UpdateMultiFactorInfoRequest =
| UpdatePhoneMultiFactorInfoRequest;


/**
* Interface representing the properties to update on the provided user.
Expand Down Expand Up @@ -446,7 +454,7 @@ export namespace auth {
* Interface representing base properties of a user enrolled second factor for a
* `CreateRequest`.
*/
export interface CreateMultiFactorInfoRequest {
export interface BaseCreateMultiFactorInfoRequest {

/**
* The optional display name for an enrolled second factor.
Expand All @@ -463,13 +471,21 @@ export namespace auth {
* Interface representing a phone specific user enrolled second factor for a
* `CreateRequest`.
*/
export interface CreatePhoneMultiFactorInfoRequest extends CreateMultiFactorInfoRequest {
export interface CreatePhoneMultiFactorInfoRequest extends BaseCreateMultiFactorInfoRequest {

/**
* The phone number associated with a phone second factor.
*/
phoneNumber: string;
}

/**
* Interface representing properties of a user enrolled second factor for a
* `CreateRequest`.
*/
export type CreateMultiFactorInfoRequest =
| CreatePhoneMultiFactorInfoRequest;


/**
* Interface representing the properties to set on a new user record to be
Expand Down