Skip to main content
References

Passwordless Types

Type Aliases

InputType

type InputType = RecipeConfig<PreAndPostAPIHookAction> & UserInput;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:49

NormalisedInputType

type NormalisedInputType = NormalisedRecipeConfig<PreAndPostAPIHookAction> & object;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:51

Type Declaration

PasswordlessFlowType

type PasswordlessFlowType = "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK";

Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:60

PostAPIHookContext

type PostAPIHookContext = RecipePostAPIHookContext<PreAndPostAPIHookAction>;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:35

PreAndPostAPIHookAction

type PreAndPostAPIHookAction = 
| "PASSWORDLESS_CREATE_CODE"
| "PASSWORDLESS_CONSUME_CODE"
| "PASSWORDLESS_RESEND_CODE"
| "EMAIL_EXISTS"
| "PHONE_NUMBER_EXISTS";

Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:27

PreAPIHookContext

type PreAPIHookContext = RecipePreAPIHookContext<PreAndPostAPIHookAction>;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:34

RecipeInterface

type RecipeInterface = object;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:62

Properties

PropertyTypeDescriptionDefined in
clearLoginAttemptInfo(input) => Promise<void>Clear any information about login attempts from storagetmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:312
consumeCode(input) => Promise< | { createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User; } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR"; } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR"; } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED"; }>Log the user in using the input code or link code Throws STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:168
createCode(input) => Promise< | { deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK"; } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED"; }>Create and send a code to the user for passwordless auth Throws STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:80
doesEmailExist(input) => Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK"; }>Check if a user with the given email exists Throws STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:244
doesPhoneNumberExist(input) => Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK"; }>Check if a user with the given phone number exists Throws STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:263
getLinkCodeFromURL(input) => stringReads and returns the link code from the current URLtmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:211
getLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input) => Promise<undefined | object & CustomLoginAttemptInfoProperties>Get information about the current login attempt from storagetmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:280
getPreAuthSessionIdFromURL(input) => stringReads and returns the pre auth session id from the current URLtmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:229
getTenantIdFromURL(input) => string | undefinedReads and returns the tenant id from the current URLtmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:220
resendCode(input) => Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR"; }>Resend the code to the user Throws STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:128
setLoginAttemptInfo<CustomStateProperties>(input) => Promise<void>Set information about the current login attempt to storagetmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:296

UserInput

type UserInput = object & RecipeModuleUserInput<PreAndPostAPIHookAction>;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:37

Type Declaration

NameTypeDescriptionDefined in
override?objectRefer to the documentationtmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:41
override.functions()?(originalImplementation, builder) => RecipeInterface-tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:42