Skip to content

twofactor#

disable2fa#

const disable2fa: (password, code) => Promise<void>;

Disable 2FA — requires the account password plus a TOTP or recovery code.

Parameters#

Parameter Type
password string
code string

Returns#

Promise<void>


regenerateRecoveryCodes#

const regenerateRecoveryCodes: (code) => Promise<string[]>;

Replace recovery codes (invalidates the old set). Requires a valid TOTP code.

Parameters#

Parameter Type
code string

Returns#

Promise<string[]>


setup2fa#

const setup2fa: () => Promise<TwoFactorSetup>;

Begin enrollment — returns the secret + otpauth URI (not yet enabled).

Returns#

Promise<TwoFactorSetup>


verify2faSetup#

const verify2faSetup: (code) => Promise<string[]>;

Confirm enrollment with a code from the authenticator. Returns one-time recovery codes.

Parameters#

Parameter Type
code string

Returns#

Promise<string[]>


TwoFactorSetup#

Two-factor auth (TOTP) account-management API. All endpoints require an authenticated session (the axios interceptor attaches the access token) and operate only on the current user. UI lives per-consumer; logic lives here.

Properties#

otpauth_uri#

otpauth_uri: string;

secret#

secret: string;