supertokens-auth-react/recipe/passwordless
References documentation for the supertokens-auth-react/recipe/passwordless package
Classes
default
Defined in: recipe/passwordless/index.ts
Constructors
Constructor
new default(): default;
Returns
Properties
| Property | Modifier | Type | Default value | Defined in |
|---|---|---|---|---|
ComponentsOverrideProvider |
static |
any |
RecipeComponentsOverrideContextProvider |
recipe/passwordless/index.ts |
Methods
clearLoginAttemptInfo()
static clearLoginAttemptInfo(input?): Promise<void>;
Defined in: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
input? |
{ userContext?: UserContext; } |
input.userContext? |
UserContext |
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: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
input? |
| { options?: RecipeFunctionOptions; userContext?: UserContext; userInputCode: string; } | { options?: RecipeFunctionOptions; userContext?: UserContext; } |
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";
}>
createCode()
static createCode(input): Promise<
| {
deviceId: string;
fetchResponse: Response;
flowType: PasswordlessFlowType;
preAuthSessionId: string;
status: "OK";
}
| {
reason: string;
status: "SIGN_IN_UP_NOT_ALLOWED";
}>;
Defined in: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
input |
| { email: string; options?: RecipeFunctionOptions; shouldTryLinkingWithSessionUser?: boolean; userContext?: UserContext; } | { options?: RecipeFunctionOptions; phoneNumber: string; shouldTryLinkingWithSessionUser?: boolean; userContext?: UserContext; } |
Returns
Promise<
| {
deviceId: string;
fetchResponse: Response;
flowType: PasswordlessFlowType;
preAuthSessionId: string;
status: "OK";
}
| {
reason: string;
status: "SIGN_IN_UP_NOT_ALLOWED";
}>
doesEmailExist()
static doesEmailExist(input): Promise<{
doesExist: boolean;
fetchResponse: Response;
status: "OK";
}>;
Defined in: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
input |
{ email: string; options?: RecipeFunctionOptions; userContext?: UserContext; } |
input.email |
string |
input.options? |
RecipeFunctionOptions |
input.userContext? |
UserContext |
Returns
Promise<{
doesExist: boolean;
fetchResponse: Response;
status: "OK";
}>
doesPhoneNumberExist()
static doesPhoneNumberExist(input): Promise<{
doesExist: boolean;
fetchResponse: Response;
status: "OK";
}>;
Defined in: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
input |
{ options?: RecipeFunctionOptions; phoneNumber: string; userContext?: UserContext; } |
input.options? |
RecipeFunctionOptions |
input.phoneNumber |
string |
input.userContext? |
UserContext |
Returns
Promise<{
doesExist: boolean;
fetchResponse: Response;
status: "OK";
}>
getLinkCodeFromURL()
static getLinkCodeFromURL(input?): string;
Defined in: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
input? |
{ userContext?: UserContext; } |
input.userContext? |
UserContext |
Returns
string
getLoginAttemptInfo()
static getLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input?): Promise<object & CustomLoginAttemptInfoProperties>;
Defined in: recipe/passwordless/index.ts
Type Parameters
| Type Parameter |
|---|
CustomLoginAttemptInfoProperties |
Parameters
| Parameter | Type |
|---|---|
input? |
{ userContext?: UserContext; } |
input.userContext? |
UserContext |
Returns
Promise<object & CustomLoginAttemptInfoProperties>
getPreAuthSessionIdFromURL()
static getPreAuthSessionIdFromURL(input?): string;
Defined in: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
input? |
{ userContext?: UserContext; } |
input.userContext? |
UserContext |
Returns
string
init()
static init(config): any;
Defined in: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
config |
UserInput |
Returns
any
resendCode()
static resendCode(input?): Promise<{
fetchResponse: Response;
status: "OK" | "RESTART_FLOW_ERROR";
}>;
Defined in: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
input? |
{ options?: RecipeFunctionOptions; userContext?: UserContext; } |
input.options? |
RecipeFunctionOptions |
input.userContext? |
UserContext |
Returns
Promise<{
fetchResponse: Response;
status: "OK" | "RESTART_FLOW_ERROR";
}>
setLoginAttemptInfo()
static setLoginAttemptInfo<CustomStateProperties>(input): Promise<void>;
Defined in: recipe/passwordless/index.ts
Type Parameters
| Type Parameter |
|---|
CustomStateProperties |
Parameters
| Parameter | Type |
|---|---|
input |
{ attemptInfo: object & CustomStateProperties; userContext?: UserContext; } |
input.attemptInfo |
object & CustomStateProperties |
input.userContext? |
UserContext |
Returns
Promise<void>
signOut()
static signOut(input?): Promise<void>;
Defined in: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
input? |
{ userContext?: UserContext; } |
input.userContext? |
UserContext |
Returns
Promise<void>
Variables
clearLoginAttemptInfo()
const clearLoginAttemptInfo: (input?) => Promise<void> = Wrapper.clearLoginAttemptInfo;
Defined in: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
input? |
{ userContext?: UserContext; } |
input.userContext? |
UserContext |
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";
}> = Wrapper.consumeCode;
Defined in: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
input? |
| { options?: RecipeFunctionOptions; userContext?: UserContext; userInputCode: string; } | { options?: RecipeFunctionOptions; userContext?: UserContext; } |
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";
}>
createCode()
const createCode: (input) => Promise<
| {
deviceId: string;
fetchResponse: Response;
flowType: PasswordlessFlowType;
preAuthSessionId: string;
status: "OK";
}
| {
reason: string;
status: "SIGN_IN_UP_NOT_ALLOWED";
}> = Wrapper.createCode;
Defined in: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
input |
| { email: string; options?: RecipeFunctionOptions; shouldTryLinkingWithSessionUser?: boolean; userContext?: UserContext; } | { options?: RecipeFunctionOptions; phoneNumber: string; shouldTryLinkingWithSessionUser?: boolean; userContext?: UserContext; } |
Returns
Promise<
| {
deviceId: string;
fetchResponse: Response;
flowType: PasswordlessFlowType;
preAuthSessionId: string;
status: "OK";
}
| {
reason: string;
status: "SIGN_IN_UP_NOT_ALLOWED";
}>
doesEmailExist()
const doesEmailExist: (input) => Promise<{
doesExist: boolean;
fetchResponse: Response;
status: "OK";
}> = Wrapper.doesEmailExist;
Defined in: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
input |
{ email: string; options?: RecipeFunctionOptions; userContext?: UserContext; } |
input.email |
string |
input.options? |
RecipeFunctionOptions |
input.userContext? |
UserContext |
Returns
Promise<{
doesExist: boolean;
fetchResponse: Response;
status: "OK";
}>
doesPhoneNumberExist()
const doesPhoneNumberExist: (input) => Promise<{
doesExist: boolean;
fetchResponse: Response;
status: "OK";
}> = Wrapper.doesPhoneNumberExist;
Defined in: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
input |
{ options?: RecipeFunctionOptions; phoneNumber: string; userContext?: UserContext; } |
input.options? |
RecipeFunctionOptions |
input.phoneNumber |
string |
input.userContext? |
UserContext |
Returns
Promise<{
doesExist: boolean;
fetchResponse: Response;
status: "OK";
}>
getLinkCodeFromURL()
const getLinkCodeFromURL: (input?) => string = Wrapper.getLinkCodeFromURL;
Defined in: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
input? |
{ userContext?: UserContext; } |
input.userContext? |
UserContext |
Returns
string
getLoginAttemptInfo()
const getLoginAttemptInfo: <CustomLoginAttemptInfoProperties>(input?) => Promise<object & CustomLoginAttemptInfoProperties> = Wrapper.getLoginAttemptInfo;
Defined in: recipe/passwordless/index.ts
Type Parameters
| Type Parameter |
|---|
CustomLoginAttemptInfoProperties |
Parameters
| Parameter | Type |
|---|---|
input? |
{ userContext?: UserContext; } |
input.userContext? |
UserContext |
Returns
Promise<object & CustomLoginAttemptInfoProperties>
getPreAuthSessionIdFromURL()
const getPreAuthSessionIdFromURL: (input?) => string = Wrapper.getPreAuthSessionIdFromURL;
Defined in: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
input? |
{ userContext?: UserContext; } |
input.userContext? |
UserContext |
Returns
string
init()
const init: (config) => any = Wrapper.init;
Defined in: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
config |
UserInput |
Returns
any
PasswordlessComponentsOverrideProvider
const PasswordlessComponentsOverrideProvider: any = Wrapper.ComponentsOverrideProvider;
Defined in: recipe/passwordless/index.ts
resendCode()
const resendCode: (input?) => Promise<{
fetchResponse: Response;
status: "OK" | "RESTART_FLOW_ERROR";
}> = Wrapper.resendCode;
Defined in: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
input? |
{ options?: RecipeFunctionOptions; userContext?: UserContext; } |
input.options? |
RecipeFunctionOptions |
input.userContext? |
UserContext |
Returns
Promise<{
fetchResponse: Response;
status: "OK" | "RESTART_FLOW_ERROR";
}>
setLoginAttemptInfo()
const setLoginAttemptInfo: <CustomStateProperties>(input) => Promise<void> = Wrapper.setLoginAttemptInfo;
Defined in: recipe/passwordless/index.ts
Type Parameters
| Type Parameter |
|---|
CustomStateProperties |
Parameters
| Parameter | Type |
|---|---|
input |
{ attemptInfo: object & CustomStateProperties; userContext?: UserContext; } |
input.attemptInfo |
object & CustomStateProperties |
input.userContext? |
UserContext |
Returns
Promise<void>
signOut()
const signOut: (input?) => Promise<void> = Wrapper.signOut;
Defined in: recipe/passwordless/index.ts
Parameters
| Parameter | Type |
|---|---|
input? |
{ userContext?: UserContext; } |
input.userContext? |
UserContext |
Returns
Promise<void>
References
GetRedirectionURLContext
Re-exports GetRedirectionURLContext
OnHandleEventContext
Re-exports OnHandleEventContext
PreAPIHookContext
Re-exports PreAPIHookContext
RecipeInterface
Renames and re-exports SuperTokensWrapper
UserInput
Re-exports UserInput