Options
All
  • Public
  • Public/Protected
  • All
Menu

Contains the full multi-factor authentication API.

Hierarchy

  • GoTrueMFAApi

Index

Methods

  • Prepares a challenge used to verify that a user has access to a MFA factor.

    Parameters

    Returns Promise<AuthMFAChallengeResponse>

  • Helper method which creates a challenge and immediately uses the given code to verify against it thereafter. The verification code is provided by the user by entering a code seen in their authenticator app.

    Parameters

    Returns Promise<AuthMFAVerifyResponse>

  • enroll(params: MFAEnrollTOTPParams): Promise<AuthMFAEnrollTOTPResponse>
  • enroll(params: MFAEnrollPhoneParams): Promise<AuthMFAEnrollPhoneResponse>
  • enroll(params: MFAEnrollParams): Promise<AuthMFAEnrollResponse>
  • Starts the enrollment process for a new Multi-Factor Authentication (MFA) factor. This method creates a new unverified factor. To verify a factor, present the QR code or secret to the user and ask them to add it to their authenticator app. The user has to enter the code from their authenticator app to verify it.

    Upon verifying a factor, all other sessions are logged out and the current session's authenticator level is promoted to aal2.

    Parameters

    • params: MFAEnrollTOTPParams

    Returns Promise<AuthMFAEnrollTOTPResponse>

  • Parameters

    • params: MFAEnrollPhoneParams

    Returns Promise<AuthMFAEnrollPhoneResponse>

  • Parameters

    Returns Promise<AuthMFAEnrollResponse>

  • Returns the Authenticator Assurance Level (AAL) for the active session.

    • aal1 (or null) means that the user's identity has been verified only with a conventional login (email+password, OTP, magic link, social login, etc.).
    • aal2 means that the user's identity has been verified both with a conventional login and at least one MFA factor.

    Although this method returns a promise, it's fairly quick (microseconds) and rarely uses the network. You can use this to check whether the current user needs to be shown a screen to verify their MFA factors.

    Returns Promise<AuthMFAGetAuthenticatorAssuranceLevelResponse>

  • Returns the list of MFA factors enabled for this user.

    see

    {@link GoTrueMFAApi#enroll}

    see

    {@link GoTrueMFAApi#getAuthenticatorAssuranceLevel}

    see

    {@link GoTrueClient#getUser}

    Returns Promise<AuthMFAListFactorsResponse>

  • Unenroll removes a MFA factor. A user has to have an aal2 authenticator level in order to unenroll a verified factor.

    Parameters

    Returns Promise<AuthMFAUnenrollResponse>

  • Verifies a code against a challenge. The verification code is provided by the user by entering a code seen in their authenticator app.

    Parameters

    Returns Promise<AuthMFAVerifyResponse>

Generated using TypeDoc