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

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

Usage

1import { AlchemyWebSigner } from "@account-kit/signer";
2
3const signer = new AlchemyWebSigner({
4 client: {
5 connection: {
6 rpcUrl: "/api/rpc",
7 },
8 iframeConfig: {
9 iframeContainerId: "alchemy-signer-iframe-container",
10 },
11 },
12});
13
14// After MFA is required and user provides code
15const user = await signer.validateMultiFactors({
16 multiFactorCode: "123456", // 6-digit code from authenticator app
17 multiFactorId: "factor-id",
18});

Parameters

params

ValidateMultiFactorsArgs

  • Parameters for validating MFA factors

    Returns

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