supertokens-node/recipe/passwordless/types
References documentation for the supertokens-node/recipe/passwordless/types package
Type Aliases
APIInterface
type APIInterface = object;
Defined in: recipe/passwordless/types.ts
Properties
| Property | Type | Defined in |
|---|---|---|
consumeCodePOST? |
(input) => Promise< | { createdNewRecipeUser: boolean; session: SessionContainerInterface; status: "OK"; user: User; } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR"; } | { status: "RESTART_FLOW_ERROR"; } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED"; } | GeneralErrorResponse> |
recipe/passwordless/types.ts |
createCodePOST? |
(input) => Promise< | { deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK"; } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED"; } | GeneralErrorResponse> |
recipe/passwordless/types.ts |
emailExistsGET? |
(input) => Promise< | { exists: boolean; status: "OK"; } | GeneralErrorResponse> |
recipe/passwordless/types.ts |
phoneNumberExistsGET? |
(input) => Promise< | { exists: boolean; status: "OK"; } | GeneralErrorResponse> |
recipe/passwordless/types.ts |
resendCodePOST? |
(input) => Promise< | GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK"; }> |
recipe/passwordless/types.ts |
APIOptions
type APIOptions = object;
Defined in: recipe/passwordless/types.ts
Properties
| Property | Type | Defined in |
|---|---|---|
appInfo |
NormalisedAppinfo |
recipe/passwordless/types.ts |
config |
TypeNormalisedInput |
recipe/passwordless/types.ts |
emailDelivery |
EmailDeliveryIngredient<TypePasswordlessEmailDeliveryInput> |
recipe/passwordless/types.ts |
isInServerlessEnv |
boolean |
recipe/passwordless/types.ts |
recipeId |
string |
recipe/passwordless/types.ts |
recipeImplementation |
RecipeInterface |
recipe/passwordless/types.ts |
req |
BaseRequest |
recipe/passwordless/types.ts |
res |
BaseResponse |
recipe/passwordless/types.ts |
smsDelivery |
SmsDeliveryIngredient<TypePasswordlessSmsDeliveryInput> |
recipe/passwordless/types.ts |
DeviceType
type DeviceType = object;
Defined in: recipe/passwordless/types.ts
Properties
| Property | Type | Defined in |
|---|---|---|
codes |
object[] |
recipe/passwordless/types.ts |
email? |
string |
recipe/passwordless/types.ts |
failedCodeInputAttemptCount |
number |
recipe/passwordless/types.ts |
phoneNumber? |
string |
recipe/passwordless/types.ts |
preAuthSessionId |
string |
recipe/passwordless/types.ts |
RecipeInterface
type RecipeInterface = object;
Defined in: recipe/passwordless/types.ts
Properties
| Property | Type | Defined in |
|---|---|---|
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"; }> |
recipe/passwordless/types.ts |
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"; }> |
recipe/passwordless/types.ts |
createCode |
(input) => Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string; }> |
recipe/passwordless/types.ts |
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"; }> |
recipe/passwordless/types.ts |
listCodesByDeviceId |
(input) => Promise<DeviceType | undefined> |
recipe/passwordless/types.ts |
listCodesByEmail |
(input) => Promise<DeviceType[]> |
recipe/passwordless/types.ts |
listCodesByPhoneNumber |
(input) => Promise<DeviceType[]> |
recipe/passwordless/types.ts |
listCodesByPreAuthSessionId |
(input) => Promise<DeviceType | undefined> |
recipe/passwordless/types.ts |
revokeAllCodes |
(input) => Promise<{ status: "OK"; }> |
recipe/passwordless/types.ts |
revokeCode |
(input) => Promise<{ status: "OK"; }> |
recipe/passwordless/types.ts |
updateUser |
(input) => Promise< | { status: | "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR"; } | { reason: string; status: | "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR"; }> |
recipe/passwordless/types.ts |
TypeInput
type TypeInput =
| {
contactMethod: "PHONE";
validatePhoneNumber?: (phoneNumber, tenantId) => Promise<string | undefined> | string | undefined;
}
| {
contactMethod: "EMAIL";
validateEmailAddress?: (email, tenantId) => Promise<string | undefined> | string | undefined;
}
| {
contactMethod: "EMAIL_OR_PHONE";
validateEmailAddress?: (email, tenantId) => Promise<string | undefined> | string | undefined;
validatePhoneNumber?: (phoneNumber, tenantId) => Promise<string | undefined> | string | undefined;
} & object;
Defined in: recipe/passwordless/types.ts
Type Declaration
| Name | Type | Defined in |
|---|---|---|
emailDelivery? |
EmailDeliveryTypeInput<TypePasswordlessEmailDeliveryInput> |
recipe/passwordless/types.ts |
flowType |
"USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK" |
recipe/passwordless/types.ts |
getCustomUserInputCode()? |
(tenantId, userContext) => Promise<string> | string |
recipe/passwordless/types.ts |
override? |
object |
recipe/passwordless/types.ts |
override.apis()? |
(originalImplementation, builder) => APIInterface |
recipe/passwordless/types.ts |
override.functions()? |
(originalImplementation, builder) => RecipeInterface |
recipe/passwordless/types.ts |
smsDelivery? |
SmsDeliveryTypeInput<TypePasswordlessSmsDeliveryInput> |
recipe/passwordless/types.ts |
TypeNormalisedInput
type TypeNormalisedInput =
| {
contactMethod: "PHONE";
validatePhoneNumber: (phoneNumber, tenantId) => Promise<string | undefined> | string | undefined;
}
| {
contactMethod: "EMAIL";
validateEmailAddress: (email, tenantId) => Promise<string | undefined> | string | undefined;
}
| {
contactMethod: "EMAIL_OR_PHONE";
validateEmailAddress: (email, tenantId) => Promise<string | undefined> | string | undefined;
validatePhoneNumber: (phoneNumber, tenantId) => Promise<string | undefined> | string | undefined;
} & object;
Defined in: recipe/passwordless/types.ts
Type Declaration
| Name | Type | Defined in |
|---|---|---|
flowType |
"USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK" |
recipe/passwordless/types.ts |
getCustomUserInputCode()? |
(tenantId, userContext) => Promise<string> | string |
recipe/passwordless/types.ts |
getEmailDeliveryConfig() |
() => EmailDeliveryTypeInputWithService<TypePasswordlessEmailDeliveryInput> |
recipe/passwordless/types.ts |
getSmsDeliveryConfig() |
() => SmsDeliveryTypeInputWithService<TypePasswordlessSmsDeliveryInput> |
recipe/passwordless/types.ts |
override |
object |
recipe/passwordless/types.ts |
override.apis() |
(originalImplementation, builder) => APIInterface |
recipe/passwordless/types.ts |
override.functions() |
(originalImplementation, builder) => RecipeInterface |
recipe/passwordless/types.ts |
TypePasswordlessEmailDeliveryInput
type TypePasswordlessEmailDeliveryInput = object;
Defined in: recipe/passwordless/types.ts
Properties
| Property | Type | Defined in |
|---|---|---|
codeLifetime |
number |
recipe/passwordless/types.ts |
email |
string |
recipe/passwordless/types.ts |
isFirstFactor |
boolean |
recipe/passwordless/types.ts |
preAuthSessionId |
string |
recipe/passwordless/types.ts |
tenantId |
string |
recipe/passwordless/types.ts |
type |
"PASSWORDLESS_LOGIN" |
recipe/passwordless/types.ts |
urlWithLinkCode? |
string |
recipe/passwordless/types.ts |
userInputCode? |
string |
recipe/passwordless/types.ts |
TypePasswordlessSmsDeliveryInput
type TypePasswordlessSmsDeliveryInput = object;
Defined in: recipe/passwordless/types.ts
Properties
| Property | Type | Defined in |
|---|---|---|
codeLifetime |
number |
recipe/passwordless/types.ts |
isFirstFactor |
boolean |
recipe/passwordless/types.ts |
phoneNumber |
string |
recipe/passwordless/types.ts |
preAuthSessionId |
string |
recipe/passwordless/types.ts |
tenantId |
string |
recipe/passwordless/types.ts |
type |
"PASSWORDLESS_LOGIN" |
recipe/passwordless/types.ts |
urlWithLinkCode? |
string |
recipe/passwordless/types.ts |
userInputCode? |
string |
recipe/passwordless/types.ts |