Passwordless
Classes
default
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:30
Constructors
Constructor
new default(): default;
Returns
Methods
clearLoginAttemptInfo()
static clearLoginAttemptInfo(input?): Promise<void>;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:432
Clear any information about login attempts from storage
Parameters
Returns
Promise<void>
consumeCode()
static 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";
}>;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:181
Log the user in using the input code or link code
Parameters
Returns
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"; }>
{status: "OK", user, createdNewRecipeUser: bool} if succesful
Throws
STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"
createCode()
static createCode(input): Promise<
| {
deviceId: string;
fetchResponse: Response;
flowType: PasswordlessFlowType;
preAuthSessionId: string;
status: "OK";
}
| {
fetchResponse: Response;
reason: string;
status: "SIGN_IN_UP_NOT_ALLOWED";
}>;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:52
Create and send a code to the user for passwordless auth
Parameters
Returns
Promise< | { deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK"; } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED"; }>
{status: "OK", deviceId, preAuthSessionId, flowType} If successful
Throws
STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"
doesEmailExist()
static doesEmailExist(input): Promise<{
doesExist: boolean;
fetchResponse: Response;
status: "OK";
}>;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:338
Check if a user with the given email exists
Parameters
Returns
Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK"; }>
{status: "OK", doesExist: boolean}
Throws
STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"
doesPhoneNumberExist()
static doesPhoneNumberExist(input): Promise<{
doesExist: boolean;
fetchResponse: Response;
status: "OK";
}>;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:362
Check if a user with the given phone number exists
Parameters
Returns
Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK"; }>
{status: "OK", doesExist: boolean}
Throws
STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"
getLinkCodeFromURL()
static getLinkCodeFromURL(input?): string;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:290
Reads and returns the link code from the current URL
Parameters
Returns
string
The hash (#) property of the current URL
getLoginAttemptInfo()
static getLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input?): Promise<object & CustomLoginAttemptInfoProperties>;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:384
Get information about the current login attempt from storage
Type Parameters
Parameters
Returns
Promise<object & CustomLoginAttemptInfoProperties>
{deviceId, preAuthSessionId, flowType} if present, returns undefined otherwise
getPreAuthSessionIdFromURL()
static getPreAuthSessionIdFromURL(input?): string;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:304
Reads and returns the pre auth session id from the current URL
Parameters
Returns
string
The "preAuthSessionId" query parameter from the current URL
getTenantIdFromURL()
static getTenantIdFromURL(input?): string;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:318
Reads and returns the tenant id from the current URL
Parameters
Returns
string
The "tenantId" query parameter from the current location
init()
static init(config?): CreateRecipeFunction<PreAndPostAPIHookAction>;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:31
Parameters
Returns
CreateRecipeFunction<PreAndPostAPIHookAction>
resendCode()
static resendCode(input?): Promise<{
fetchResponse: Response;
status: "OK" | "RESTART_FLOW_ERROR";
}>;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:127
Resend the code to the user
Parameters
Returns
Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR"; }>
{status: "OK"} if succesful
Throws
STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"
setLoginAttemptInfo()
static setLoginAttemptInfo<CustomStateProperties>(input): Promise<void>;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:405
Set information about the current login attempt to storage
Type Parameters
Parameters
Returns
Promise<void>
signOut()
static signOut(input?): Promise<void>;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:439
Parameters
Returns
Promise<void>
Variables
clearLoginAttemptInfo()
const clearLoginAttemptInfo: (input?) => Promise<void> = RecipeWrapper.clearLoginAttemptInfo;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:458
Clear any information about login attempts from storage
Parameters
Returns
Promise<void>
consumeCode()
const 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";
}> = RecipeWrapper.consumeCode;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:449
Log the user in using the input code or link code
Parameters
Returns
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"; }>
{status: "OK", user, createdNewRecipeUser: bool} if succesful
Throws
STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"
createCode()
const createCode: (input) => Promise<
| {
deviceId: string;
fetchResponse: Response;
flowType: PasswordlessFlowType;
preAuthSessionId: string;
status: "OK";
}
| {
fetchResponse: Response;
reason: string;
status: "SIGN_IN_UP_NOT_ALLOWED";
}> = RecipeWrapper.createCode;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:447
Create and send a code to the user for passwordless auth
Parameters
Returns
Promise< | { deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK"; } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED"; }>
{status: "OK", deviceId, preAuthSessionId, flowType} If successful
Throws
STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"
doesEmailExist()
const doesEmailExist: (input) => Promise<{
doesExist: boolean;
fetchResponse: Response;
status: "OK";
}> = RecipeWrapper.doesEmailExist;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:450
Check if a user with the given email exists
Parameters
Returns
Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK"; }>
{status: "OK", doesExist: boolean}
Throws
STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"
doesPhoneNumberExist()
const doesPhoneNumberExist: (input) => Promise<{
doesExist: boolean;
fetchResponse: Response;
status: "OK";
}> = RecipeWrapper.doesPhoneNumberExist;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:451
Check if a user with the given phone number exists
Parameters
Returns
Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK"; }>
{status: "OK", doesExist: boolean}
Throws
STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"
getLinkCodeFromURL()
const getLinkCodeFromURL: (input?) => string = RecipeWrapper.getLinkCodeFromURL;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:453
Reads and returns the link code from the current URL
Parameters
Returns
string
The hash (#) property of the current URL
getLoginAttemptInfo()
const getLoginAttemptInfo: <CustomLoginAttemptInfoProperties>(input?) => Promise<object & CustomLoginAttemptInfoProperties> = RecipeWrapper.getLoginAttemptInfo;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:456
Get information about the current login attempt from storage
Type Parameters
Parameters
Returns
Promise<object & CustomLoginAttemptInfoProperties>
{deviceId, preAuthSessionId, flowType} if present, returns undefined otherwise
getPreAuthSessionIdFromURL()
const getPreAuthSessionIdFromURL: (input?) => string = RecipeWrapper.getPreAuthSessionIdFromURL;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:454
Reads and returns the pre auth session id from the current URL
Parameters
Returns
string
The "preAuthSessionId" query parameter from the current URL
getTenantIdFromURL()
const getTenantIdFromURL: (input?) => string = RecipeWrapper.getTenantIdFromURL;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:455
Reads and returns the tenant id from the current URL
Parameters
Returns
string
The "tenantId" query parameter from the current location
init()
const init: (config?) => CreateRecipeFunction<PreAndPostAPIHookAction> = RecipeWrapper.init;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:446
Parameters
Returns
CreateRecipeFunction<PreAndPostAPIHookAction>
resendCode()
const resendCode: (input?) => Promise<{
fetchResponse: Response;
status: "OK" | "RESTART_FLOW_ERROR";
}> = RecipeWrapper.resendCode;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:448
Resend the code to the user
Parameters
Returns
Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR"; }>
{status: "OK"} if succesful
Throws
STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"
setLoginAttemptInfo()
const setLoginAttemptInfo: <CustomStateProperties>(input) => Promise<void> = RecipeWrapper.setLoginAttemptInfo;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:457
Set information about the current login attempt to storage
Type Parameters
Parameters
Returns
Promise<void>
signOut()
const signOut: (input?) => Promise<void> = RecipeWrapper.signOut;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/passwordless/index.ts:452
Parameters
Returns
Promise<void>
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