diff --git a/docs/classes/index.default.html b/docs/classes/index.default.html index 0d9bbaed..a5c69637 100644 --- a/docs/classes/index.default.html +++ b/docs/classes/index.default.html @@ -1 +1 @@ -default | supertokens-web-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Methods

Constructors

Methods

  • init(config: SuperTokensConfig): void

Generated using TypeDoc

\ No newline at end of file +default | supertokens-web-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Methods

Constructors

Methods

  • init(config: SuperTokensConfig): void

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_authRecipe.default.html b/docs/classes/recipe_authRecipe.default.html index a93e5079..4dd9e00e 100644 --- a/docs/classes/recipe_authRecipe.default.html +++ b/docs/classes/recipe_authRecipe.default.html @@ -1 +1 @@ -default | supertokens-web-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<Action, NormalisedConfig> Abstract

Type Parameters

  • Action

  • NormalisedConfig extends NormalisedRecipeConfig<Action>

Hierarchy

  • default<Action, NormalisedConfig>
    • default

Index

Constructors

Properties

Methods

Constructors

  • new default<Action, NormalisedConfig>(config: NormalisedConfig): default<Action, NormalisedConfig>

Properties

config: NormalisedConfig

Methods

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

Generated using TypeDoc

\ No newline at end of file +default | supertokens-web-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<Action, NormalisedConfig> Abstract

Type Parameters

  • Action

  • NormalisedConfig extends NormalisedRecipeConfig<Action>

Hierarchy

  • default<Action, NormalisedConfig>
    • default

Index

Constructors

Properties

Methods

Constructors

  • new default<Action, NormalisedConfig>(config: NormalisedConfig): default<Action, NormalisedConfig>

Properties

config: NormalisedConfig

Methods

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

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_emailpassword.default.html b/docs/classes/recipe_emailpassword.default.html index 2761ad7c..4c6ca178 100644 --- a/docs/classes/recipe_emailpassword.default.html +++ b/docs/classes/recipe_emailpassword.default.html @@ -1,26 +1,26 @@ -default | supertokens-web-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Methods

  • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • +default | supertokens-web-js
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Methods

    • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
    • Check if an 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}

      -
    • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
    • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
    • Reads and returns the reset password token from the current URL

      Parameters

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

      Returns string

      The "token" query parameter from the current location

      -
    • getTenantIdFromURL(input?: { userContext?: any }): undefined | string
    • 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

      -
    • init(config?: UserInput): CreateRecipeFunction<PreAndPostAPIHookAction>
    • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
    • init(config?: UserInput): CreateRecipeFunction<PreAndPostAPIHookAction>
    • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
    • Send an email to the user for password reset

      throws

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

      Parameters

      • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
        • formFields: { id: string; value: string }[]
        • Optional options?: RecipeFunctionOptions
        • Optional userContext?: any

      Returns Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

      {status: "OK"} if successfull

      -
    • signIn(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_NOT_ALLOWED" }>
    • signIn(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_NOT_ALLOWED" }>
    • Sign in a user with email and password

      throws

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

      Parameters

      • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
        • formFields: { id: string; value: string }[]
        • Optional options?: RecipeFunctionOptions
        • Optional userContext?: any

      Returns Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_NOT_ALLOWED" }>

      {status: "OK"} if successfull

      -
    • signOut(input?: { userContext?: any }): Promise<void>
    • signUp(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_UP_NOT_ALLOWED" }>
    • signOut(input?: { userContext?: any }): Promise<void>
    • signUp(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_UP_NOT_ALLOWED" }>
    • Sign up a user with email and password

      throws

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

      Parameters

      • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
        • formFields: { id: string; value: string }[]
        • Optional options?: RecipeFunctionOptions
        • Optional userContext?: any

      Returns Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_UP_NOT_ALLOWED" }>

      {status: "OK"} if successfull

      -
    • submitNewPassword(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
    • submitNewPassword(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

    Parameters

    • userContext: any

    Returns Promise<void>

validators: { hasValue: any } & BooleanValidators & { isVerified: any }

Methods

  • getLastFetchedTime(payload: any, _userContext?: any): undefined | number
  • Parameters

    • payload: any
    • Optional _userContext: any

    Returns undefined | number

  • getValueFromPayload(payload: any, _userContext?: any): boolean
  • Parameters

    • payload: any
    • Optional _userContext: any

    Returns boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_emailverification.default.html b/docs/classes/recipe_emailverification.default.html index 41dfc721..0ba10cbc 100644 --- a/docs/classes/recipe_emailverification.default.html +++ b/docs/classes/recipe_emailverification.default.html @@ -1,15 +1,15 @@ -default | supertokens-web-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

EmailVerificationClaim: EmailVerificationClaimClass = Recipe.EmailVerificationClaim

Methods

  • getEmailVerificationTokenFromURL(input?: { userContext?: any }): string
  • getTenantIdFromURL(input?: { userContext?: any }): undefined | string
  • validate:function
    • Decides if the claim is valid based on the accessTokenPayload object (and not checking DB or anything else)

      -

      Parameters

      • accessTokenPayload: any
      • userContext: any

      Returns ClaimValidationResult | Promise<ClaimValidationResult>

  • UserInput: Omit<WebsiteInputType, "apiDomain" | "apiBasePath" | "enableDebugLogs" | "cookieHandler" | "windowHandler">

    Functions

    • addAxiosInterceptors(axiosInstance: any, userContext?: any): void
    • attemptRefreshingSession(): Promise<boolean>
    • doesSessionExist(input?: { userContext?: any }): Promise<boolean>
    • getAccessToken(input?: { userContext?: any }): Promise<undefined | string>
    • getAccessTokenPayloadSecurely(input?: { userContext?: any }): Promise<any>
    • getClaimValue<T>(input: { claim: SessionClaim<T>; userContext?: any }): Promise<undefined | T>
    • getInvalidClaimsFromResponse(input: { response: Response | { data: any }; userContext?: any }): Promise<ClaimValidationError[]>
    • getUserId(input?: { userContext?: any }): Promise<string>
    • init(config?: UserInput): CreateRecipeFunction<unknown>
    • signOut(input?: { userContext?: any }): Promise<void>

    Generated using TypeDoc

    \ No newline at end of file +

    Parameters

    Returns ClaimValidationResult | Promise<ClaimValidationResult>

    UserInput: Omit<WebsiteInputType, "apiDomain" | "apiBasePath" | "enableDebugLogs" | "cookieHandler" | "windowHandler">

    Functions

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_thirdparty.html b/docs/modules/recipe_thirdparty.html index 2cf358b0..8dd35a16 100644 --- a/docs/modules/recipe_thirdparty.html +++ b/docs/modules/recipe_thirdparty.html @@ -1,29 +1,29 @@ -recipe/thirdparty | supertokens-web-js
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdparty

    Index

    Type Aliases

    PostAPIHookContext: RecipePostAPIHookContext<PreAndPostAPIHookAction>
    PreAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>
    PreAndPostAPIHookAction: "GET_AUTHORISATION_URL" | "THIRD_PARTY_SIGN_IN_UP"
    RecipeInterface: { generateStateToSendToOAuthProvider: any; getAuthErrorFromURL: any; getAuthStateFromURL: any; getAuthorisationURLFromBackend: any; getAuthorisationURLWithQueryParamsAndSetState: any; getStateAndOtherInfoFromStorage: any; setStateAndOtherInfoToStorage: any; signInAndUp: any; verifyAndGetStateOrThrowError: any }

    Type declaration

    • generateStateToSendToOAuthProvider:function
      • generateStateToSendToOAuthProvider(input?: { frontendRedirectURI?: string; userContext: any }): string
      • +recipe/thirdparty | supertokens-web-js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/thirdparty

        Index

        Type Aliases

        PostAPIHookContext: RecipePostAPIHookContext<PreAndPostAPIHookAction>
        PreAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>
        PreAndPostAPIHookAction: "GET_AUTHORISATION_URL" | "THIRD_PARTY_SIGN_IN_UP"
        RecipeInterface: { generateStateToSendToOAuthProvider: any; getAuthErrorFromURL: any; getAuthStateFromURL: any; getAuthorisationURLFromBackend: any; getAuthorisationURLWithQueryParamsAndSetState: any; getStateAndOtherInfoFromStorage: any; setStateAndOtherInfoToStorage: any; signInAndUp: any; verifyAndGetStateOrThrowError: any }

        Type declaration

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

            -
        • getAuthErrorFromURL:function
          • getAuthErrorFromURL(input: { userContext: any }): undefined | string
        • getAuthErrorFromURL:function
          • getAuthErrorFromURL(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

            -
        • getAuthStateFromURL:function
          • getAuthStateFromURL(input: { userContext: any }): string
        • getAuthStateFromURL:function
          • getAuthStateFromURL(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

            -
        • getAuthorisationURLFromBackend:function
          • getAuthorisationURLFromBackend(input: { options?: RecipeFunctionOptions; redirectURIOnProviderDashboard: string; tenantId: string | undefined; thirdPartyId: string; userContext: any }): Promise<{ fetchResponse: Response; pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: 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?}

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

            -
        • getStateAndOtherInfoFromStorage:function
          • getStateAndOtherInfoFromStorage<CustomStateProperties>(input: { userContext: any }): undefined | StateObject & CustomStateProperties
        • getStateAndOtherInfoFromStorage:function
          • getStateAndOtherInfoFromStorage<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

            -
        • setStateAndOtherInfoToStorage:function
          • setStateAndOtherInfoToStorage<CustomStateProperties>(input: { state: StateObject & CustomStateProperties; userContext: any }): Promise<void>
        • setStateAndOtherInfoToStorage:function
          • setStateAndOtherInfoToStorage<CustomStateProperties>(input: { state: StateObject & CustomStateProperties; userContext: any }): Promise<void>
        • signInAndUp:function
          • signInAndUp(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" }>
        • signInAndUp:function
          • signInAndUp(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

            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

            -
        • verifyAndGetStateOrThrowError:function
          • verifyAndGetStateOrThrowError<CustomStateProperties>(input: { stateFromAuthProvider: string | undefined; stateObjectFromStorage: StateObject & CustomStateProperties | undefined; userContext: any }): Promise<StateObject & CustomStateProperties>
        • verifyAndGetStateOrThrowError:function
          • verifyAndGetStateOrThrowError<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>

        StateObject: { expiresAt: number; pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; stateForAuthProvider: string; tenantId?: string; thirdPartyId: string }

        Type declaration

        • expiresAt: number
        • Optional pkceCodeVerifier?: string
        • redirectURIOnProviderDashboard: string
        • stateForAuthProvider: string
        • Optional tenantId?: string
        • thirdPartyId: string
        UserInput: { override?: { functions?: any } } & RecipeModuleUserInput<PreAndPostAPIHookAction>

        Functions

        • getAuthorisationURLWithQueryParamsAndSetState(input: { frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; thirdPartyId: string; userContext?: any }): Promise<string>
        • 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>

        • getStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
        • signInAndUp(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" }>
        • 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" }>

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

        Legend

        • Variable
        • Function
        • Function with type parameter
        • Type alias
        • Class
        • Class with type parameter

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file +

        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>

    StateObject: { expiresAt: number; pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; stateForAuthProvider: string; tenantId?: string; thirdPartyId: string }

    Type declaration

    • expiresAt: number
    • Optional pkceCodeVerifier?: string
    • redirectURIOnProviderDashboard: string
    • stateForAuthProvider: string
    • Optional tenantId?: string
    • thirdPartyId: string
    UserInput: { override?: { functions?: any } } & RecipeModuleUserInput<PreAndPostAPIHookAction>

    Functions

    • getAuthorisationURLWithQueryParamsAndSetState(input: { frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; thirdPartyId: string; userContext?: any }): Promise<string>
    • 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>

    • getStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
    • signInAndUp(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" }>
    • 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" }>

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

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_thirdpartyemailpassword.html b/docs/modules/recipe_thirdpartyemailpassword.html index 41fb7960..ad283d58 100644 --- a/docs/modules/recipe_thirdpartyemailpassword.html +++ b/docs/modules/recipe_thirdpartyemailpassword.html @@ -1,54 +1,54 @@ -recipe/thirdpartyemailpassword | supertokens-web-js
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdpartyemailpassword

    Index

    References

    Re-exports RecipeFunctionOptions

    Type Aliases

    PostAPIHookContext: RecipePostAPIHookContext<PreAndPostAPIHookAction>
    PreAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>
    RecipeInterface: { doesEmailExist: any; emailPasswordSignIn: any; emailPasswordSignUp: any; generateStateToSendToOAuthProvider: any; getAuthErrorFromURL: any; getAuthStateFromURL: any; getAuthorisationURLFromBackend: any; getAuthorisationURLWithQueryParamsAndSetState: any; getResetPasswordTokenFromURL: any; getStateAndOtherInfoFromStorage: any; getTenantIdFromURL: any; sendPasswordResetEmail: any; setStateAndOtherInfoToStorage: any; submitNewPassword: any; thirdPartySignInAndUp: any; verifyAndGetStateOrThrowError: any }

    Type declaration

    • doesEmailExist:function
      • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
      • +recipe/thirdpartyemailpassword | supertokens-web-js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/thirdpartyemailpassword

        Index

        References

        Re-exports RecipeFunctionOptions

        Type Aliases

        PostAPIHookContext: RecipePostAPIHookContext<PreAndPostAPIHookAction>
        PreAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>
        RecipeInterface: { doesEmailExist: any; emailPasswordSignIn: any; emailPasswordSignUp: any; generateStateToSendToOAuthProvider: any; getAuthErrorFromURL: any; getAuthStateFromURL: any; getAuthorisationURLFromBackend: any; getAuthorisationURLWithQueryParamsAndSetState: any; getResetPasswordTokenFromURL: any; getStateAndOtherInfoFromStorage: any; getTenantIdFromURL: any; sendPasswordResetEmail: any; setStateAndOtherInfoToStorage: any; submitNewPassword: any; thirdPartySignInAndUp: any; verifyAndGetStateOrThrowError: any }

        Type declaration

        • doesEmailExist:function
          • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
        • emailPasswordSignIn:function
          • emailPasswordSignIn(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext: any }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_NOT_ALLOWED" }>
        • emailPasswordSignIn:function
          • emailPasswordSignIn(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext: any }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_NOT_ALLOWED" }>
          • Sign in a user with email and password

            throws

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

            Parameters

            Returns Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_NOT_ALLOWED" }>

            {status: "OK"} if successfull

            -
        • emailPasswordSignUp:function
          • emailPasswordSignUp(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext: any }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_UP_NOT_ALLOWED" }>
        • emailPasswordSignUp:function
          • emailPasswordSignUp(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext: any }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_UP_NOT_ALLOWED" }>
          • Sign up a user with email and password

            throws

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

            Parameters

            Returns Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_UP_NOT_ALLOWED" }>

            {status: "OK"} if successfull

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

            Parameters

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

            Returns string

            string

            -
        • getAuthErrorFromURL:function
          • getAuthErrorFromURL(input: { userContext: any }): undefined | string
        • getAuthErrorFromURL:function
          • getAuthErrorFromURL(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

            -
        • getAuthStateFromURL:function
          • getAuthStateFromURL(input: { userContext: any }): string
        • getAuthStateFromURL:function
          • getAuthStateFromURL(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

            -
        • getAuthorisationURLFromBackend:function
          • getAuthorisationURLFromBackend(input: { options?: RecipeFunctionOptions; redirectURIOnProviderDashboard: string; tenantId: string | undefined; thirdPartyId: string; userContext: any }): Promise<{ fetchResponse: Response; pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: 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?}

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

            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

            -
        • getResetPasswordTokenFromURL:function
          • getResetPasswordTokenFromURL(input: { userContext: any }): string
        • getResetPasswordTokenFromURL:function
          • getResetPasswordTokenFromURL(input: { userContext: any }): string
        • getStateAndOtherInfoFromStorage:function
          • getStateAndOtherInfoFromStorage<CustomStateProperties>(input: { userContext: any }): undefined | StateObject & CustomStateProperties
        • getStateAndOtherInfoFromStorage:function
          • getStateAndOtherInfoFromStorage<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

            -
        • getTenantIdFromURL:function
          • getTenantIdFromURL(input: { userContext: any }): undefined | string
        • getTenantIdFromURL:function
          • getTenantIdFromURL(input: { userContext: any }): undefined | string
        • sendPasswordResetEmail:function
          • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext: any }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
        • sendPasswordResetEmail:function
          • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext: any }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
          • Send an email to the user for password reset

            throws

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

            Parameters

            Returns Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

            {status: "OK"} if successfull

            -
        • setStateAndOtherInfoToStorage:function
          • setStateAndOtherInfoToStorage<CustomStateProperties>(input: { state: StateObject & CustomStateProperties; userContext: any }): Promise<void>
        • setStateAndOtherInfoToStorage:function
          • setStateAndOtherInfoToStorage<CustomStateProperties>(input: { state: StateObject & CustomStateProperties; userContext: any }): Promise<void>
        • submitNewPassword:function
          • submitNewPassword(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext: any }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
        • submitNewPassword:function
          • submitNewPassword(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext: any }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
          • Submit a new password for the user

            throws

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

            Parameters

            Returns Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

            {status: "OK"} if successfull

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

            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

            -
        • verifyAndGetStateOrThrowError:function
          • verifyAndGetStateOrThrowError<CustomStateProperties>(input: { stateFromAuthProvider: string | undefined; stateObjectFromStorage: StateObject & CustomStateProperties | undefined; userContext: any }): Promise<StateObject & CustomStateProperties>
        • verifyAndGetStateOrThrowError:function
          • verifyAndGetStateOrThrowError<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: { override?: { functions?: any } } & RecipeModuleUserInput<PreAndPostAPIHookAction>

        Functions

        • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
        • emailPasswordSignIn(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_NOT_ALLOWED" }>
        • Parameters

          • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
            • formFields: { id: string; value: string }[]
            • Optional options?: RecipeFunctionOptions
            • Optional userContext?: any

          Returns Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_NOT_ALLOWED" }>

        • emailPasswordSignUp(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_UP_NOT_ALLOWED" }>
        • Parameters

          • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
            • formFields: { id: string; value: string }[]
            • Optional options?: RecipeFunctionOptions
            • Optional userContext?: any

          Returns Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_UP_NOT_ALLOWED" }>

        • getAuthorisationURLWithQueryParamsAndSetState(input: { frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; thirdPartyId: string; userContext?: any }): Promise<string>
        • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
        • getStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
        • getTenantIdFromURL(input?: { userContext?: any }): undefined | string
        • init(config?: UserInput): CreateRecipeFunction<PreAndPostAPIHookAction>
        • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
        • Parameters

          • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
            • formFields: { id: string; value: string }[]
            • Optional options?: RecipeFunctionOptions
            • Optional userContext?: any

          Returns Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

        • signOut(input?: { userContext?: any }): Promise<void>
        • submitNewPassword(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
        • Parameters

          • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
            • formFields: { id: string; value: string }[]
            • Optional options?: RecipeFunctionOptions
            • Optional userContext?: any

          Returns Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

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

        Legend

        • Variable
        • Function
        • Function with type parameter
        • Type alias
        • Class
        • Class with type parameter

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file +

        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: { override?: { functions?: any } } & RecipeModuleUserInput<PreAndPostAPIHookAction>

    Functions

    • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
    • emailPasswordSignIn(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_NOT_ALLOWED" }>
    • Parameters

      • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
        • formFields: { id: string; value: string }[]
        • Optional options?: RecipeFunctionOptions
        • Optional userContext?: any

      Returns Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_NOT_ALLOWED" }>

    • emailPasswordSignUp(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_UP_NOT_ALLOWED" }>
    • Parameters

      • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
        • formFields: { id: string; value: string }[]
        • Optional options?: RecipeFunctionOptions
        • Optional userContext?: any

      Returns Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_UP_NOT_ALLOWED" }>

    • getAuthorisationURLWithQueryParamsAndSetState(input: { frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; thirdPartyId: string; userContext?: any }): Promise<string>
    • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
    • getStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
    • getTenantIdFromURL(input?: { userContext?: any }): undefined | string
    • init(config?: UserInput): CreateRecipeFunction<PreAndPostAPIHookAction>
    • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
    • Parameters

      • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
        • formFields: { id: string; value: string }[]
        • Optional options?: RecipeFunctionOptions
        • Optional userContext?: any

      Returns Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

    • signOut(input?: { userContext?: any }): Promise<void>
    • submitNewPassword(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
    • Parameters

      • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
        • formFields: { id: string; value: string }[]
        • Optional options?: RecipeFunctionOptions
        • Optional userContext?: any

      Returns Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

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

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_thirdpartypasswordless.html b/docs/modules/recipe_thirdpartypasswordless.html index 78945a9c..2c70ad3f 100644 --- a/docs/modules/recipe_thirdpartypasswordless.html +++ b/docs/modules/recipe_thirdpartypasswordless.html @@ -1,65 +1,65 @@ -recipe/thirdpartypasswordless | supertokens-web-js
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdpartypasswordless

    Index

    References

    Re-exports RecipeFunctionOptions

    Type Aliases

    PasswordlessFlowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"
    PostAPIHookContext: RecipePostAPIHookContext<PreAndPostAPIHookAction>
    PreAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>
    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>
      • +recipe/thirdpartypasswordless | supertokens-web-js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/thirdpartypasswordless

        Index

        References

        Re-exports RecipeFunctionOptions

        Type Aliases

        PasswordlessFlowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"
        PostAPIHookContext: RecipePostAPIHookContext<PreAndPostAPIHookAction>
        PreAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>
        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>
        • 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" }>
        • 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" }>
        • 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

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

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

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

            {status: "OK", doesExist: boolean}

            -
        • generateThirdPartyStateToSendToOAuthProvider:function
          • generateThirdPartyStateToSendToOAuthProvider(input?: { frontendRedirectURI?: string; userContext: any }): string
        • 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 }>
        • 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
        • getPasswordlessLinkCodeFromURL:function
          • getPasswordlessLinkCodeFromURL(input: { userContext: any }): string
        • getPasswordlessLoginAttemptInfo:function
          • getPasswordlessLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input: { userContext: any }): Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties>
        • 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
        • 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
        • 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
        • 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
        • 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>
        • 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
        • 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" }>
        • 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>
        • 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>
        • setThirdPartyStateAndOtherInfoToStorage:function
          • setThirdPartyStateAndOtherInfoToStorage<CustomStateProperties>(input: { state: StateObject & CustomStateProperties; userContext: any }): 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" }>
        • 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

            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>
        • 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: { override?: { functions?: any } } & RecipeModuleUserInput<PreAndPostAPIHookAction>

        Functions

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

        • 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" }>
        • doesPasswordlessUserEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
        • doesPasswordlessUserPhoneNumberExist(input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
        • getPasswordlessLinkCodeFromURL(input?: { userContext?: any }): string
        • getPasswordlessLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input?: { userContext?: any }): Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId: undefined | string } & CustomLoginAttemptInfoProperties>
        • Type Parameters

          • CustomLoginAttemptInfoProperties

          Parameters

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

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

        • getPasswordlessPreAuthSessionIdFromURL(input?: { userContext?: any }): string
        • getTenantIdFromURL(input?: { userContext?: any }): undefined | string
        • getThirdPartyAuthorisationURLWithQueryParamsAndSetState(input: { frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; thirdPartyId: string; userContext?: any }): Promise<string>
        • getThirdPartyStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
        • 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>
        • 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" }>
        • 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" }>

        Legend

        • Variable
        • Function
        • Function with type parameter
        • Type alias
        • Class
        • Class with type parameter

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file +

        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: { override?: { functions?: any } } & RecipeModuleUserInput<PreAndPostAPIHookAction>

    Functions

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

    • 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" }>
    • doesPasswordlessUserEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
    • doesPasswordlessUserPhoneNumberExist(input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
    • getPasswordlessLinkCodeFromURL(input?: { userContext?: any }): string
    • getPasswordlessLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input?: { userContext?: any }): Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId: undefined | string } & CustomLoginAttemptInfoProperties>
    • Type Parameters

      • CustomLoginAttemptInfoProperties

      Parameters

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

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

    • getPasswordlessPreAuthSessionIdFromURL(input?: { userContext?: any }): string
    • getTenantIdFromURL(input?: { userContext?: any }): undefined | string
    • getThirdPartyAuthorisationURLWithQueryParamsAndSetState(input: { frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; thirdPartyId: string; userContext?: any }): Promise<string>
    • getThirdPartyStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
    • 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>
    • 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" }>
    • 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" }>

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_userroles.html b/docs/modules/recipe_userroles.html index 6b5a0d89..0ee28736 100644 --- a/docs/modules/recipe_userroles.html +++ b/docs/modules/recipe_userroles.html @@ -1 +1 @@ -recipe/userroles | supertokens-web-js
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/userroles

    Index

    Variables

    PermissionClaim: PrimitiveArrayClaim<string> = ...
    UserRoleClaim: PrimitiveArrayClaim<string> = ...

    Generated using TypeDoc

    \ No newline at end of file +recipe/userroles | supertokens-web-js
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/userroles

    Index

    Variables

    PermissionClaim: PrimitiveArrayClaim<string> = ...
    UserRoleClaim: PrimitiveArrayClaim<string> = ...

    Generated using TypeDoc

    \ No newline at end of file