Skip to content
Esc
navigateopen⌘Jpreview
Dashboard
On this page

supertokens-web-js/recipe/multifactorauth

References documentation for the supertokens-web-js/recipe/multifactorauth package

Classes

default

Defined in: tmp/supertokens-web-js/lib/ts/recipe/multifactorauth/index.ts

Constructors

Constructor
new default(): default;
Returns

default

Properties

Property Modifier Type Default value Defined in
MultiFactorAuthClaim static MultiFactorAuthClaimClass Recipe.MultiFactorAuthClaim tmp/supertokens-web-js/lib/ts/recipe/multifactorauth/index.ts

Methods

init()
static init(config?): CreateRecipeFunction<"GET_MFA_INFO">;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/multifactorauth/index.ts

Parameters
Parameter Type
config? UserInput
Returns

CreateRecipeFunction<"GET_MFA_INFO">

resyncSessionAndFetchMFAInfo()
static resyncSessionAndFetchMFAInfo(input?): Promise<{
  emails: Record<string, string[] | undefined>;
  factors: MFAFactorInfo;
  fetchResponse: Response;
  phoneNumbers: Record<string, string[] | undefined>;
  status: "OK";
}>;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/multifactorauth/index.ts

Loads information about what factors the current session can set up/complete and updates the requirements in the session payload

Parameters
Parameter Type
input? { options?: RecipeFunctionOptions; userContext?: any; }
input.options? RecipeFunctionOptions
input.userContext? any
Returns

Promise<{ emails: Record<string, string[] | undefined>; factors: MFAFactorInfo; fetchResponse: Response; phoneNumbers: Record<string, string[] | undefined>; status: "OK"; }>

{ status: "OK", ...} if successful


MultiFactorAuthClaimClass

Defined in: tmp/supertokens-web-js/lib/ts/recipe/multifactorauth/multiFactorAuthClaim.ts

We include “Class” in the class name, because it makes it easier to import/use the right thing (the instance exported by the recipe) instead of this.

Implements

Constructors

Constructor
new MultiFactorAuthClaimClass(getRecipeImpl): MultiFactorAuthClaimClass;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/multifactorauth/multiFactorAuthClaim.ts

Parameters
Parameter Type
getRecipeImpl () => RecipeInterface
Returns

MultiFactorAuthClaimClass

Properties

Property Modifier Type Default value Defined in
getRecipeImpl protected () => RecipeInterface undefined tmp/supertokens-web-js/lib/ts/recipe/multifactorauth/multiFactorAuthClaim.ts
id public string "st-mfa" tmp/supertokens-web-js/lib/ts/recipe/multifactorauth/multiFactorAuthClaim.ts
validators public object undefined tmp/supertokens-web-js/lib/ts/recipe/multifactorauth/multiFactorAuthClaim.ts
validators.hasCompletedFactors public (requirements) => SessionClaimValidator undefined tmp/supertokens-web-js/lib/ts/recipe/multifactorauth/multiFactorAuthClaim.ts
validators.hasCompletedMFARequirementsForAuth public () => SessionClaimValidator undefined tmp/supertokens-web-js/lib/ts/recipe/multifactorauth/multiFactorAuthClaim.ts

Methods

getLastFetchedTime()
getLastFetchedTime(payload, _userContext?): number;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/multifactorauth/multiFactorAuthClaim.ts

Parameters
Parameter Type
payload any
_userContext? any
Returns

number

Implementation of

SessionClaim.getLastFetchedTime

getValueFromPayload()
getValueFromPayload(payload, _userContext?): object;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/multifactorauth/multiFactorAuthClaim.ts

Parameters
Parameter Type
payload any
_userContext? any
Returns

object

Implementation of

SessionClaim.getValueFromPayload

refresh()
refresh(userContext): Promise<void>;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/multifactorauth/multiFactorAuthClaim.ts

Parameters
Parameter Type
userContext any
Returns

Promise<void>

Implementation of

SessionClaim.refresh

Variables

init()

const init: (config?) => CreateRecipeFunction<"GET_MFA_INFO"> = RecipeWrapper.init;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/multifactorauth/index.ts

Parameters

Parameter Type
config? UserInput

Returns

CreateRecipeFunction<"GET_MFA_INFO">


MultiFactorAuthClaim

const MultiFactorAuthClaim: MultiFactorAuthClaimClass = RecipeWrapper.MultiFactorAuthClaim;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/multifactorauth/index.ts


resyncSessionAndFetchMFAInfo()

const resyncSessionAndFetchMFAInfo: (input?) => Promise<{
  emails: Record<string, string[] | undefined>;
  factors: MFAFactorInfo;
  fetchResponse: Response;
  phoneNumbers: Record<string, string[] | undefined>;
  status: "OK";
}> = RecipeWrapper.resyncSessionAndFetchMFAInfo;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/multifactorauth/index.ts

Loads information about what factors the current session can set up/complete and updates the requirements in the session payload

Parameters

Parameter Type
input? { options?: RecipeFunctionOptions; userContext?: any; }
input.options? RecipeFunctionOptions
input.userContext? any

Returns

Promise<{ emails: Record<string, string[] | undefined>; factors: MFAFactorInfo; fetchResponse: Response; phoneNumbers: Record<string, string[] | undefined>; status: "OK"; }>

{ status: "OK", ...} if successful

References

PostAPIHookContext

Re-exports PostAPIHookContext


PreAndPostAPIHookAction

Re-exports PreAndPostAPIHookAction


PreAPIHookContext

Re-exports PreAPIHookContext


RecipeFunctionOptions

Re-exports RecipeFunctionOptions


RecipeInterface

Re-exports RecipeInterface


UserInput

Re-exports UserInput

API reference

API schema and response details