Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Methods

  • clearPasswordlessLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumePasswordlessCode(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

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

    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

  • doesPasswordlessUserEmailExist(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}

  • doesPasswordlessUserPhoneNumberExist(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}

  • getPasswordlessLinkCodeFromURL(input?: { userContext?: any }): string
  • getPasswordlessLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input?: { userContext?: any }): Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId: undefined | 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; tenantId: undefined | string } & CustomLoginAttemptInfoProperties>

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

  • getPasswordlessPreAuthSessionIdFromURL(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

  • getThirdPartyAuthorisationURLWithQueryParamsAndSetState(input: { frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; thirdPartyId: string; userContext?: any }): Promise<string>
  • Get the URL that should be opened for third party authentication

    throws

    STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

    Parameters

    • input: { frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; thirdPartyId: string; userContext?: any }
      • frontendRedirectURI: string
      • Optional options?: RecipeFunctionOptions
      • Optional redirectURIOnProviderDashboard?: string
      • thirdPartyId: string
      • Optional userContext?: any

    Returns Promise<string>

    URL string

  • getThirdPartyStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
  • Get the current login state from storage, this is also used when calling signInUp

    Type Parameters

    • CustomStateProperties

    Parameters

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

    Returns undefined | StateObject & CustomStateProperties

    State object from storage

  • resendPasswordlessCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
  • setPasswordlessLoginAttemptInfo<CustomStateProperties>(input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & 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 } & CustomStateProperties; userContext?: any }
      • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties
      • Optional userContext?: any

    Returns Promise<void>

  • signOut(input?: { userContext?: any }): Promise<void>
  • thirdPartySignInAndUp(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Sign up/Sign in the user, this method uses the login attempt information from storage

    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 } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    {status: OK, user, createdNewRecipeUser: boolean} if succesful

Generated using TypeDoc