Passwordless
Classes
default
Defined in: recipe/passwordless/index.ts:31
Constructors
Constructor
new default(): default;
Returns
Properties
Methods
checkCode()
static checkCode(input): Promise<
| {
consumedDevice: {
email?: string;
failedCodeInputAttemptCount: number;
phoneNumber?: string;
preAuthSessionId: string;
};
status: "OK";
}
| {
failedCodeInputAttemptCount: number;
maximumCodeInputAttempts: number;
status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR";
}
| {
status: "RESTART_FLOW_ERROR";
}>;
Defined in: recipe/passwordless/index.ts:219
This function will only verify the code (not consume it), and: NOT create a new user if it doesn't exist NOT verify the user email if it exists NOT do any linking NOT delete the code unless it returned RESTART_FLOW_ERROR
Parameters
Returns
Promise< | { consumedDevice: { email?: string; failedCodeInputAttemptCount: number; phoneNumber?: string; preAuthSessionId: string; }; status: "OK"; } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR"; } | { status: "RESTART_FLOW_ERROR"; }>
consumeCode()
Call Signature
static consumeCode(input): Promise<
| {
consumedDevice: {
email?: string;
failedCodeInputAttemptCount: number;
phoneNumber?: string;
preAuthSessionId: string;
};
createdNewRecipeUser: boolean;
recipeUserId: RecipeUserId;
status: "OK";
user: User;
}
| {
failedCodeInputAttemptCount: number;
maximumCodeInputAttempts: number;
status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR";
}
| {
status: "RESTART_FLOW_ERROR";
}>;
Defined in: recipe/passwordless/index.ts:77
- verifies the code
- creates the user if it doesn't exist
- tries to link it
- marks the email as verified
Parameters
Returns
Promise< | { consumedDevice: { email?: string; failedCodeInputAttemptCount: number; phoneNumber?: string; preAuthSessionId: string; }; createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User; } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR"; } | { status: "RESTART_FLOW_ERROR"; }>
Call Signature
static consumeCode(input): Promise<
| {
consumedDevice: {
email?: string;
failedCodeInputAttemptCount: number;
phoneNumber?: string;
preAuthSessionId: string;
};
createdNewRecipeUser: boolean;
recipeUserId: RecipeUserId;
status: "OK";
user: User;
}
| {
failedCodeInputAttemptCount: number;
maximumCodeInputAttempts: number;
status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR";
}
| {
status: "RESTART_FLOW_ERROR";
}
| {
reason: | "EMAIL_VERIFICATION_REQUIRED"
| "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
| "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
| "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR";
status: "LINKING_TO_SESSION_USER_FAILED";
}>;
Defined in: recipe/passwordless/index.ts:114
- verifies the code
- creates the user if it doesn't exist
- tries to link it
- marks the email as verified
Parameters
Returns
Promise< | { consumedDevice: { email?: string; failedCodeInputAttemptCount: number; phoneNumber?: string; preAuthSessionId: string; }; createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User; } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR"; } | { status: "RESTART_FLOW_ERROR"; } | { reason: | "EMAIL_VERIFICATION_REQUIRED" | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; status: "LINKING_TO_SESSION_USER_FAILED"; }>
createCode()
static createCode(input): Promise<{
codeId: string;
codeLifetime: number;
deviceId: string;
linkCode: string;
preAuthSessionId: string;
status: "OK";
timeCreated: number;
userInputCode: string;
}>;
Defined in: recipe/passwordless/index.ts:36
Parameters
Returns
Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string; }>
createMagicLink()
static createMagicLink(input): Promise<string>;
Defined in: recipe/passwordless/index.ts:331
Parameters
Returns
Promise<string>
createNewCodeForDevice()
static createNewCodeForDevice(input): Promise<
| {
codeId: string;
codeLifetime: number;
deviceId: string;
linkCode: string;
preAuthSessionId: string;
status: "OK";
timeCreated: number;
userInputCode: string;
}
| {
status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR";
}>;
Defined in: recipe/passwordless/index.ts:59
Parameters
Returns
Promise< | { codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string; } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR"; }>
listCodesByDeviceId()
static listCodesByDeviceId(input): Promise<DeviceType>;
Defined in: recipe/passwordless/index.ts:313
Parameters
Returns
Promise<DeviceType>
listCodesByEmail()
static listCodesByEmail(input): Promise<DeviceType[]>;
Defined in: recipe/passwordless/index.ts:299
Parameters
Returns
Promise<DeviceType[]>
listCodesByPhoneNumber()
static listCodesByPhoneNumber(input): Promise<DeviceType[]>;
Defined in: recipe/passwordless/index.ts:306
Parameters
Returns
Promise<DeviceType[]>
listCodesByPreAuthSessionId()
static listCodesByPreAuthSessionId(input): Promise<DeviceType>;
Defined in: recipe/passwordless/index.ts:320
Parameters
Returns
Promise<DeviceType>
revokeAllCodes()
static revokeAllCodes(input): Promise<{
status: "OK";
}>;
Defined in: recipe/passwordless/index.ts:269
Parameters
Returns
Promise<{ status: "OK"; }>
revokeCode()
static revokeCode(input): Promise<{
status: "OK";
}>;
Defined in: recipe/passwordless/index.ts:288
Parameters
Returns
Promise<{ status: "OK"; }>
sendEmail()
static sendEmail(input): Promise<void>;
Defined in: recipe/passwordless/index.ts:373
Parameters
Returns
Promise<void>
sendSms()
static sendSms(input): Promise<void>;
Defined in: recipe/passwordless/index.ts:380
Parameters
Returns
Promise<void>
signInUp()
static signInUp(input): Promise<{
createdNewRecipeUser: boolean;
recipeUserId: RecipeUserId;
status: string;
user: User;
}>;
Defined in: recipe/passwordless/index.ts:352
Parameters
Returns
Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User; }>
updateUser()
static updateUser(input): Promise<
| {
status: | "OK"
| "EMAIL_ALREADY_EXISTS_ERROR"
| "UNKNOWN_USER_ID_ERROR"
| "PHONE_NUMBER_ALREADY_EXISTS_ERROR";
}
| {
reason: string;
status: | "EMAIL_CHANGE_NOT_ALLOWED_ERROR"
| "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR";
}>;
Defined in: recipe/passwordless/index.ts:257
Parameters
Returns
Promise< | { status: | "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR"; } | { reason: string; status: | "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR"; }>
Variables
checkCode()
checkCode: (input) => Promise<
| {
consumedDevice: {
email?: string;
failedCodeInputAttemptCount: number;
phoneNumber?: string;
preAuthSessionId: string;
};
status: "OK";
}
| {
failedCodeInputAttemptCount: number;
maximumCodeInputAttempts: number;
status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR";
}
| {
status: "RESTART_FLOW_ERROR";
}> = Wrapper.checkCode;
Defined in: recipe/passwordless/index.ts:416
This function will only verify the code (not consume it), and: NOT create a new user if it doesn't exist NOT verify the user email if it exists NOT do any linking NOT delete the code unless it returned RESTART_FLOW_ERROR
Parameters
Returns
Promise< | { consumedDevice: { email?: string; failedCodeInputAttemptCount: number; phoneNumber?: string; preAuthSessionId: string; }; status: "OK"; } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR"; } | { status: "RESTART_FLOW_ERROR"; }>
consumeCode()
consumeCode: {
(input): Promise<
| {
consumedDevice: {
email?: string;
failedCodeInputAttemptCount: number;
phoneNumber?: string;
preAuthSessionId: string;
};
createdNewRecipeUser: boolean;
recipeUserId: RecipeUserId;
status: "OK";
user: User;
}
| {
failedCodeInputAttemptCount: number;
maximumCodeInputAttempts: number;
status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR";
}
| {
status: "RESTART_FLOW_ERROR";
}>;
(input): Promise<
| {
consumedDevice: {
email?: string;
failedCodeInputAttemptCount: number;
phoneNumber?: string;
preAuthSessionId: string;
};
createdNewRecipeUser: boolean;
recipeUserId: RecipeUserId;
status: "OK";
user: User;
}
| {
failedCodeInputAttemptCount: number;
maximumCodeInputAttempts: number;
status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR";
}
| {
status: "RESTART_FLOW_ERROR";
}
| {
reason: | "EMAIL_VERIFICATION_REQUIRED"
| "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
| "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
| "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR";
status: "LINKING_TO_SESSION_USER_FAILED";
}>;
} = Wrapper.consumeCode;
Defined in: recipe/passwordless/index.ts:394
Call Signature
(input): Promise<
| {
consumedDevice: {
email?: string;
failedCodeInputAttemptCount: number;
phoneNumber?: string;
preAuthSessionId: string;
};
createdNewRecipeUser: boolean;
recipeUserId: RecipeUserId;
status: "OK";
user: User;
}
| {
failedCodeInputAttemptCount: number;
maximumCodeInputAttempts: number;
status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR";
}
| {
status: "RESTART_FLOW_ERROR";
}>;
- verifies the code
- creates the user if it doesn't exist
- tries to link it
- marks the email as verified
Parameters
Returns
Promise< | { consumedDevice: { email?: string; failedCodeInputAttemptCount: number; phoneNumber?: string; preAuthSessionId: string; }; createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User; } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR"; } | { status: "RESTART_FLOW_ERROR"; }>
Call Signature
(input): Promise<
| {
consumedDevice: {
email?: string;
failedCodeInputAttemptCount: number;
phoneNumber?: string;
preAuthSessionId: string;
};
createdNewRecipeUser: boolean;
recipeUserId: RecipeUserId;
status: "OK";
user: User;
}
| {
failedCodeInputAttemptCount: number;
maximumCodeInputAttempts: number;
status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR";
}
| {
status: "RESTART_FLOW_ERROR";
}
| {
reason: | "EMAIL_VERIFICATION_REQUIRED"
| "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
| "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
| "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR";
status: "LINKING_TO_SESSION_USER_FAILED";
}>;
- verifies the code
- creates the user if it doesn't exist
- tries to link it
- marks the email as verified
Parameters
Returns
Promise< | { consumedDevice: { email?: string; failedCodeInputAttemptCount: number; phoneNumber?: string; preAuthSessionId: string; }; createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User; } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR"; } | { status: "RESTART_FLOW_ERROR"; } | { reason: | "EMAIL_VERIFICATION_REQUIRED" | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; status: "LINKING_TO_SESSION_USER_FAILED"; }>
createCode()
createCode: (input) => Promise<{
codeId: string;
codeLifetime: number;
deviceId: string;
linkCode: string;
preAuthSessionId: string;
status: "OK";
timeCreated: number;
userInputCode: string;
}> = Wrapper.createCode;
Defined in: recipe/passwordless/index.ts:392
Parameters
Returns
Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string; }>
createMagicLink()
createMagicLink: (input) => Promise<string> = Wrapper.createMagicLink;
Defined in: recipe/passwordless/index.ts:412
Parameters
Returns
Promise<string>
createNewCodeForDevice()
createNewCodeForDevice: (input) => Promise<
| {
codeId: string;
codeLifetime: number;
deviceId: string;
linkCode: string;
preAuthSessionId: string;
status: "OK";
timeCreated: number;
userInputCode: string;
}
| {
status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR";
}> = Wrapper.createNewCodeForDevice;
Defined in: recipe/passwordless/index.ts:404
Parameters
Returns
Promise< | { codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string; } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR"; }>
Error
Error: typeof default = Wrapper.Error;
Defined in: recipe/passwordless/index.ts:390
init()
init: (config) => RecipeListFunction = Wrapper.init;
Defined in: recipe/passwordless/index.ts:388
Parameters
Returns
listCodesByDeviceId()
listCodesByDeviceId: (input) => Promise<DeviceType> = Wrapper.listCodesByDeviceId;
Defined in: recipe/passwordless/index.ts:396
Parameters
Returns
Promise<DeviceType>
listCodesByEmail()
listCodesByEmail: (input) => Promise<DeviceType[]> = Wrapper.listCodesByEmail;
Defined in: recipe/passwordless/index.ts:398
Parameters
Returns
Promise<DeviceType[]>
listCodesByPhoneNumber()
listCodesByPhoneNumber: (input) => Promise<DeviceType[]> = Wrapper.listCodesByPhoneNumber;
Defined in: recipe/passwordless/index.ts:400
Parameters
Returns
Promise<DeviceType[]>
listCodesByPreAuthSessionId()
listCodesByPreAuthSessionId: (input) => Promise<DeviceType> = Wrapper.listCodesByPreAuthSessionId;
Defined in: recipe/passwordless/index.ts:402
Parameters
Returns
Promise<DeviceType>
revokeAllCodes()
revokeAllCodes: (input) => Promise<{
status: "OK";
}> = Wrapper.revokeAllCodes;
Defined in: recipe/passwordless/index.ts:408
Parameters
Returns
Promise<{ status: "OK"; }>
revokeCode()
revokeCode: (input) => Promise<{
status: "OK";
}> = Wrapper.revokeCode;
Defined in: recipe/passwordless/index.ts:410
Parameters
Returns
Promise<{ status: "OK"; }>
sendEmail()
sendEmail: (input) => Promise<void> = Wrapper.sendEmail;
Defined in: recipe/passwordless/index.ts:420
Parameters
Returns
Promise<void>
sendSms()
sendSms: (input) => Promise<void> = Wrapper.sendSms;
Defined in: recipe/passwordless/index.ts:422
Parameters
Returns
Promise<void>
signInUp()
signInUp: (input) => Promise<{
createdNewRecipeUser: boolean;
recipeUserId: RecipeUserId;
status: string;
user: User;
}> = Wrapper.signInUp;
Defined in: recipe/passwordless/index.ts:414
Parameters
Returns
Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User; }>
updateUser()
updateUser: (input) => Promise<
| {
status: | "OK"
| "EMAIL_ALREADY_EXISTS_ERROR"
| "UNKNOWN_USER_ID_ERROR"
| "PHONE_NUMBER_ALREADY_EXISTS_ERROR";
}
| {
reason: string;
status: | "EMAIL_CHANGE_NOT_ALLOWED_ERROR"
| "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR";
}> = Wrapper.updateUser;
Defined in: recipe/passwordless/index.ts:406
Parameters
Returns
Promise< | { status: | "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR"; } | { reason: string; status: | "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR"; }>
References
APIInterface
Re-exports APIInterface
APIOptions
Re-exports APIOptions
RecipeInterface
Re-exports RecipeInterface