Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Methods

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • Clear any information about login attempts from storage

    Parameters

    • Optional input: { userContext?: any }
      • Optional userContext?: any

    Returns Promise<void>

  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): 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"

    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

  • createCode(input: { email: string; options?: RecipeFunctionOptions; shouldTryLinkingWithSessionUser?: boolean; userContext?: any } | { options?: RecipeFunctionOptions; phoneNumber: string; shouldTryLinkingWithSessionUser?: boolean; userContext?: any }): 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"

    Parameters

    • input: { email: string; options?: RecipeFunctionOptions; shouldTryLinkingWithSessionUser?: boolean; userContext?: any } | { options?: RecipeFunctionOptions; phoneNumber: string; shouldTryLinkingWithSessionUser?: boolean; userContext?: any }

    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

  • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): 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"

    Parameters

    Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

    {status: "OK", doesExist: boolean}

  • doesPhoneNumberExist(input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): 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"

    Parameters

    Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

    {status: "OK", doesExist: boolean}

  • getLinkCodeFromURL(input?: { userContext?: any }): string
  • Reads and returns the link code from the current URL

    Parameters

    • Optional input: { userContext?: any }
      • Optional userContext?: any

    Returns string

    The hash (#) property of the current URL

  • getLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input?: { userContext?: any }): Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; shouldTryLinkingWithSessionUser?: boolean; tenantId?: string } & CustomLoginAttemptInfoProperties>
  • Get information about the current login attempt from storage

    Type Parameters

    • CustomLoginAttemptInfoProperties

    Parameters

    • Optional input: { userContext?: any }
      • Optional userContext?: any

    Returns Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; shouldTryLinkingWithSessionUser?: boolean; tenantId?: string } & CustomLoginAttemptInfoProperties>

    {deviceId, preAuthSessionId, flowType} if present, returns undefined otherwise

  • getPreAuthSessionIdFromURL(input?: { userContext?: any }): string
  • Reads and returns the pre auth session id from the current URL

    Parameters

    • Optional input: { userContext?: any }
      • Optional userContext?: any

    Returns string

    The "preAuthSessionId" query parameter from the current URL

  • getTenantIdFromURL(input?: { userContext?: any }): undefined | string
  • Reads and returns the tenant id from the current URL

    Parameters

    • Optional input: { userContext?: any }
      • Optional userContext?: any

    Returns undefined | string

    The "tenantId" query parameter from the current location

  • resendCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): 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"

    Parameters

    Returns Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>

    {status: "OK"} if succesful

  • setLoginAttemptInfo<CustomStateProperties>(input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; shouldTryLinkingWithSessionUser?: boolean } & CustomStateProperties; userContext?: any }): Promise<void>
  • Set information about the current login attempt to storage

    Type Parameters

    • CustomStateProperties

    Parameters

    • input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; shouldTryLinkingWithSessionUser?: boolean } & CustomStateProperties; userContext?: any }
      • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; shouldTryLinkingWithSessionUser?: boolean } & CustomStateProperties
      • Optional userContext?: any

    Returns Promise<void>

  • signOut(input?: { userContext?: any }): Promise<void>

Generated using TypeDoc