Skip to content

Type Alias: TwoFactorSource ​

ts
type TwoFactorSource = 
  | {
  code: string;
}
  | {
  totpSecret: string;
}
  | {
  provider: () => string | Promise<string>;
};

Where the one-time code comes from: a literal code, a base32 TOTP secret the SDK turns into the current authenticator code, or a function that asks the caller (for example, prompting a person for an SMS or email code).

Union Members ​

Type Literal ​

ts
{
  code: string;
}

Type Literal ​

ts
{
  totpSecret: string;
}

Type Literal ​

ts
{
  provider: () => string | Promise<string>;
}

provider ​

ts
readonly provider: () => string | Promise<string>;

Called when the code is needed, for example to ask the person at the keyboard.

Returns ​

string | Promise<string>

MIT License. Not affiliated with, endorsed or sponsored by Meta or Instagram.