Skip to content

Commit

Permalink
fix: update naming
Browse files Browse the repository at this point in the history
  • Loading branch information
J0 committed Oct 9, 2024
1 parent 1670bf1 commit f26d43e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/GoTrueClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ import type {
GoTrueMFAApi,
MFAEnrollParams,
MFAVerifyParams,
AuthMFAEnrollResponse,
MFAChallengeParams,
AuthMFAChallengeResponse,
MFAUnenrollParams,
Expand All @@ -101,6 +100,7 @@ import type {
RegistrationResponseJSON,
AuthenticationCredential,
MFAVerifySingleStepWebAuthnParams,
AuthMFAEnrollResponse,
} from './lib/types'
import {
MFAEnrollTOTPParams,
Expand All @@ -111,7 +111,6 @@ import {
AuthMFAEnrollWebAuthnResponse,
} from './lib/internal-types'


polyfillGlobalThis() // Make "globalThis" available

const DEFAULT_OPTIONS: Omit<Required<GoTrueClientOptions>, 'fetch' | 'storage' | 'lock'> = {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/internal-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type MFAEnrollWebAuthnParams = {
webAuthn?: Object

/** Have the Auth client library handle the browser-authenticator interaction for you */
useMultiStepEnroll: boolean
useMultiStep: boolean
}

export type AuthMFAEnrollTOTPResponse =
Expand Down
6 changes: 5 additions & 1 deletion src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,6 @@ export type GenerateLinkType =
| 'email_change_current'
| 'email_change_new'


export type MFAVerifyTOTPParams = {
/** ID of the factor being verified. Returned in enroll(). */
factorId: string
Expand Down Expand Up @@ -903,6 +902,10 @@ export type AuthMFAVerifyResponse =
error: AuthError
}

export type AuthMFAEnrollResponse =
| AuthMFAEnrollTOTPResponse
| AuthMFAEnrollPhoneResponse
| AuthMFAEnrollWebAuthnResponse

export type AuthMFAUnenrollResponse =
| {
Expand Down Expand Up @@ -1006,6 +1009,7 @@ export interface GoTrueMFAApi {
*/
enroll(params: MFAEnrollTOTPParams): Promise<AuthMFAEnrollTOTPResponse>
enroll(params: MFAEnrollPhoneParams): Promise<AuthMFAEnrollPhoneResponse>
enroll(params: MFAEnrollWebAuthnParams): Promise<AuthMFAEnrollWebAuthnResponse>
enroll(params: MFAEnrollParams): Promise<AuthMFAEnrollResponse>

/**
Expand Down

0 comments on commit f26d43e

Please sign in to comment.