Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/thirdpartypasswordless

Index

References

Re-exports ActiveDirectory
Re-exports Apple
Re-exports Bitbucket
Re-exports BoxySAML
Re-exports Discord
Re-exports Facebook
Re-exports Github
Re-exports Gitlab
Re-exports Google
Re-exports GoogleWorkspaces
Re-exports LinkedIn
Re-exports Okta
Re-exports Twitter

Type Aliases

RecipeInterface: { clearPasswordlessLoginAttemptInfo: any; consumePasswordlessCode: any; createPasswordlessCode: any; doesPasswordlessUserEmailExist: any; doesPasswordlessUserPhoneNumberExist: any; generateThirdPartyStateToSendToOAuthProvider: any; getAuthorisationURLFromBackend: any; getPasswordlessLinkCodeFromURL: any; getPasswordlessLoginAttemptInfo: any; getPasswordlessPreAuthSessionIdFromURL: any; getTenantIdFromURL: any; getThirdPartyAuthErrorFromURL: any; getThirdPartyAuthStateFromURL: any; getThirdPartyAuthorisationURLWithQueryParamsAndSetState: any; getThirdPartyStateAndOtherInfoFromStorage: any; resendPasswordlessCode: any; setPasswordlessLoginAttemptInfo: any; setThirdPartyStateAndOtherInfoToStorage: any; thirdPartySignInAndUp: any; verifyAndGetThirdPartyStateOrThrowError: any }

Type declaration

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

      Parameters

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

      Returns Promise<void>

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

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

      • 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

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

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

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

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

  • generateThirdPartyStateToSendToOAuthProvider:function
    • generateThirdPartyStateToSendToOAuthProvider(input?: { frontendRedirectURI?: string; userContext: any }): string
    • Generate a new state that will be sent to the third party provider

      Parameters

      • Optional input: { frontendRedirectURI?: string; userContext: any }
        • Optional frontendRedirectURI?: string
        • userContext: any

      Returns string

      string

  • getAuthorisationURLFromBackend:function
    • getAuthorisationURLFromBackend(input: { options?: RecipeFunctionOptions; redirectURIOnProviderDashboard: string; tenantId: string | undefined; thirdPartyId: string; userContext: any }): Promise<{ fetchResponse: Response; pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string }>
    • Get the URL to be used by the third party provider for redirecting after the auth flow. Also returns PKCE Code Verifier if using PKCE.

      throws

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

      Parameters

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

      Returns Promise<{ fetchResponse: Response; pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string }>

      {status: "OK", url, pkceCodeVerifier?}

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

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

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

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

  • getThirdPartyAuthErrorFromURL:function
    • getThirdPartyAuthErrorFromURL(input: { userContext: any }): undefined | string
    • Returns the error from the current URL

      Parameters

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

      Returns undefined | string

      The "error" query param from the current URL. Returns undefined if no error exists

  • getThirdPartyAuthStateFromURL:function
    • getThirdPartyAuthStateFromURL(input: { userContext: any }): string
    • Returns the auth state from the current URL

      Parameters

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

      Returns string

      The "state" query param from the current URL. Returns an empty string if no state exists

  • getThirdPartyAuthorisationURLWithQueryParamsAndSetState:function
    • getThirdPartyAuthorisationURLWithQueryParamsAndSetState(input: { frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; tenantId: string | undefined; 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; tenantId: string | undefined; thirdPartyId: string; userContext: any }
        • frontendRedirectURI: string
        • Optional options?: RecipeFunctionOptions
        • Optional redirectURIOnProviderDashboard?: string
        • tenantId: string | undefined
        • thirdPartyId: string
        • userContext: any

      Returns Promise<string>

      URL string

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

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

      Returns undefined | StateObject & CustomStateProperties

      State object from storage

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

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

  • setThirdPartyStateAndOtherInfoToStorage:function
    • setThirdPartyStateAndOtherInfoToStorage<CustomStateProperties>(input: { state: StateObject & CustomStateProperties; userContext: any }): Promise<void>
    • Set the login state to storage

      Type Parameters

      • CustomStateProperties

      Parameters

      • input: { state: StateObject & CustomStateProperties; userContext: any }
        • state: StateObject & CustomStateProperties
        • userContext: any

      Returns Promise<void>

  • thirdPartySignInAndUp:function
    • thirdPartySignInAndUp(input: { options?: RecipeFunctionOptions; userContext: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; tenantId?: string; 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

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

      Returns Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; tenantId?: string; 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

  • verifyAndGetThirdPartyStateOrThrowError:function
    • verifyAndGetThirdPartyStateOrThrowError<CustomStateProperties>(input: { stateFromAuthProvider: string | undefined; stateObjectFromStorage: StateObject & CustomStateProperties | undefined; userContext: any }): Promise<StateObject & CustomStateProperties>
    • Verify that the state recieved from the third party provider matches the one in storage

      Type Parameters

      • CustomStateProperties

      Parameters

      • input: { stateFromAuthProvider: string | undefined; stateObjectFromStorage: StateObject & CustomStateProperties | undefined; userContext: any }
        • stateFromAuthProvider: string | undefined
        • stateObjectFromStorage: StateObject & CustomStateProperties | undefined
        • userContext: any

      Returns Promise<StateObject & CustomStateProperties>

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 }) & { disablePasswordless?: boolean; linkClickedScreenFeature?: PasswordlessFeatureBaseConfig; mfaFeature?: PasswordlessFeatureBaseConfig; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any } } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

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

Functions

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

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

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

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

  • getPasswordlessLinkCodeFromURL(input?: { userContext?: UserContext }): string
  • getPasswordlessLoginAttemptInfo<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>

  • getPasswordlessPreAuthSessionIdFromURL(input?: { userContext?: UserContext }): string
  • getThirdPartyAuthorisationURLWithQueryParamsAndSetState(input: { frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; thirdPartyId: string; userContext?: UserContext }): Promise<string>
  • Parameters

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

    Returns Promise<string>

  • getThirdPartyStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: UserContext }): undefined | StateObject & CustomStateProperties
  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: UserContext }): Promise<{ status: "OK" | "ERROR" }>
  • resendPasswordlessCode(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" }>

  • setPasswordlessLoginAttemptInfo<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>
  • thirdPartySignInAndUp(input?: { options?: RecipeFunctionOptions; userContext?: UserContext }): 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" }>
  • Parameters

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

    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" }>

Generated using TypeDoc