Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

GetRedirectionURLContext: never
OnHandleEventContext: { action: "SUCCESS"; createdNewSession: boolean; isNewRecipeUser: boolean; rid: "passwordless"; user: User } | { action: "PASSWORDLESS_RESTART_FLOW" } | { action: "PASSWORDLESS_CODE_SENT"; isResend: boolean } | AuthRecipeModuleOnHandleEventContext
PreAPIHookContext: { action: PreAndPostAPIHookAction; requestInit: RequestInit; url: string }

Type declaration

  • action: PreAndPostAPIHookAction
  • requestInit: RequestInit
  • url: string
RecipeInterface: { clearLoginAttemptInfo: any; consumeCode: any; createCode: any; doesEmailExist: any; doesPhoneNumberExist: any; getLinkCodeFromURL: any; getLoginAttemptInfo: any; getPreAuthSessionIdFromURL: any; getTenantIdFromURL: any; resendCode: any; setLoginAttemptInfo: any }

Type declaration

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

      Parameters

      • input: { userContext: any }
        • userContext: any

      Returns Promise<void>

  • consumeCode:function
    • consumeCode(input: { deviceId: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any; userInputCode: string } | { linkCode: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; 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

      • input: { deviceId: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any; userInputCode: string } | { linkCode: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any }

      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:function
    • createCode(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

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

      • input: { email: string; options?: RecipeFunctionOptions; userContext: any }
        • email: string
        • Optional options?: RecipeFunctionOptions
        • userContext: any

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

      {status: "OK", doesExist: boolean}

  • doesPhoneNumberExist:function
    • 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

      • input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext: any }
        • Optional options?: RecipeFunctionOptions
        • phoneNumber: string
        • userContext: any

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

      {status: "OK", doesExist: boolean}

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

      Parameters

      • input: { userContext: any }
        • userContext: any

      Returns string

      The hash (#) property of the current URL

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

      Type Parameters

      • CustomLoginAttemptInfoProperties

      Parameters

      • input: { userContext: any }
        • userContext: any

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

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

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

      Parameters

      • input: { userContext: any }
        • userContext: any

      Returns string

      The "preAuthSessionId" query parameter from the current URL

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

      Parameters

      • input: { userContext: any }
        • userContext: any

      Returns undefined | string

      The "tenantId" query parameter from the current URL

  • resendCode:function
    • resendCode(input: { deviceId: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; 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

      • input: { deviceId: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any }
        • deviceId: string
        • Optional options?: RecipeFunctionOptions
        • preAuthSessionId: string
        • tenantId: string | undefined
        • userContext: any

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

      {status: "OK"} if succesful

  • setLoginAttemptInfo:function
    • setLoginAttemptInfo<CustomStateProperties>(input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: 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; tenantId?: string } & CustomStateProperties; userContext: any }
        • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomStateProperties
        • userContext: any

      Returns Promise<void>

UserInput: ({ contactMethod: "EMAIL"; signInUpFeature?: SignInUpFeatureConfigInput; validateEmailAddress?: any } | { contactMethod: "PHONE"; signInUpFeature?: SignInUpFeatureConfigInput & { defaultCountry?: string }; validatePhoneNumber?: any } | { contactMethod: "EMAIL_OR_PHONE"; signInUpFeature?: SignInUpFeatureConfigInput & { defaultCountry?: string; guessInternationPhoneNumberFromInputPhoneNumber?: any }; validateEmailAddress?: any; validatePhoneNumber?: any }) & { linkClickedScreenFeature?: PasswordlessFeatureBaseConfig; mfaFeature?: PasswordlessFeatureBaseConfig; override?: { functions?: any } } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

PasswordlessComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

Functions

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

    • Optional 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(input: { email: string; options?: RecipeFunctionOptions; userContext?: UserContext } | { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: UserContext }): Promise<{ deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

    • input: { email: string; options?: RecipeFunctionOptions; userContext?: UserContext } | { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: UserContext }

    Returns Promise<{ deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

  • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: UserContext }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { email: string; options?: RecipeFunctionOptions; userContext?: UserContext }
      • email: string
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: UserContext

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

  • doesPhoneNumberExist(input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: UserContext }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: UserContext }
      • Optional options?: RecipeFunctionOptions
      • phoneNumber: string
      • Optional userContext?: UserContext

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

  • getLinkCodeFromURL(input?: { userContext?: UserContext }): string
  • getLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input?: { userContext?: UserContext }): Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties>
  • Type Parameters

    • CustomLoginAttemptInfoProperties

    Parameters

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

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

  • getPreAuthSessionIdFromURL(input?: { userContext?: UserContext }): string
  • resendCode(input?: { options?: RecipeFunctionOptions; userContext?: UserContext }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: UserContext }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: UserContext

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

  • setLoginAttemptInfo<CustomStateProperties>(input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: UserContext }): Promise<void>
  • Type Parameters

    • CustomStateProperties

    Parameters

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

    Returns Promise<void>

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

Generated using TypeDoc