Skip to content

validateMultiFactors

Validates MFA factors that were required during authentication. This function should be called after MFA is required and the user has provided their MFA code. It completes the authentication process by validating the MFA factors and completing the auth bundle.

Import

import { BaseAlchemySigner } from "@account-kit/signer";

Usage

import { AlchemyWebSigner } from "@account-kit/signer";
 
const signer = new AlchemyWebSigner({
  client: {
    connection: {
      rpcUrl: "/api/rpc",
    },
    iframeConfig: {
      iframeContainerId: "alchemy-signer-iframe-container",
    },
  },
});
 
// After MFA is required and user provides code
const user = await signer.validateMultiFactors({
  multiFactorCode: "123456", // 6-digit code from authenticator app
  multiFactorId: "factor-id",
});

Parameters

params

ValidateMultiFactorsArgs

  • Parameters for validating MFA factors

    Returns

    Promise<User> A promise that resolves to the authenticated user