From 792499c31b5784c095e87eff7e3b31d0e701f788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mih=C3=A1ly=20Lengyel?= Date: Mon, 16 Oct 2023 14:22:30 +0200 Subject: [PATCH 01/12] test: update for new node version (#750) * test: update test expectations to match new node version * chore: update changelog and bump version --- CHANGELOG.md | 6 +++++ lib/build/version.d.ts | 2 +- lib/ts/version.ts | 2 +- package-lock.json | 4 +-- package.json | 2 +- test/end-to-end/emailverification.test.js | 30 +++++++---------------- 6 files changed, 20 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88a44c77e..ce869efbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) +## [0.35.6] - 2023-10-16 + +### Test changes + +- Updated test expectations to match fix in the node behaviour of the emailVerifyGET endpoint + ## [0.35.5] - 2023-10-06 ### Changes diff --git a/lib/build/version.d.ts b/lib/build/version.d.ts index a27549731..51706b18d 100644 --- a/lib/build/version.d.ts +++ b/lib/build/version.d.ts @@ -1 +1 @@ -export declare const package_version = "0.35.5"; +export declare const package_version = "0.35.6"; diff --git a/lib/ts/version.ts b/lib/ts/version.ts index c769c2bf4..ac4a22bc3 100644 --- a/lib/ts/version.ts +++ b/lib/ts/version.ts @@ -12,4 +12,4 @@ * License for the specific language governing permissions and limitations * under the License. */ -export const package_version = "0.35.5"; +export const package_version = "0.35.6"; diff --git a/package-lock.json b/package-lock.json index ce7194225..edc7549ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "supertokens-auth-react", - "version": "0.35.5", + "version": "0.35.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "supertokens-auth-react", - "version": "0.35.5", + "version": "0.35.6", "license": "Apache-2.0", "dependencies": { "intl-tel-input": "^17.0.19", diff --git a/package.json b/package.json index 93f767599..98d858cee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "supertokens-auth-react", - "version": "0.35.5", + "version": "0.35.6", "description": "ReactJS SDK that provides login functionality with SuperTokens.", "main": "./index.js", "engines": { diff --git a/test/end-to-end/emailverification.test.js b/test/end-to-end/emailverification.test.js index 94489dabd..2d8f96c4d 100644 --- a/test/end-to-end/emailverification.test.js +++ b/test/end-to-end/emailverification.test.js @@ -255,13 +255,9 @@ describe("SuperTokens Email Verification", function () { "ST_LOGS SESSION OVERRIDE GET_USER_ID", "ST_LOGS EMAIL_VERIFICATION OVERRIDE IS_EMAIL_VERIFIED", "ST_LOGS EMAIL_VERIFICATION PRE_API_HOOKS IS_EMAIL_VERIFIED", - ...(accountLinkingSupported - ? [] - : [ - "ST_LOGS SESSION ON_HANDLE_EVENT ACCESS_TOKEN_PAYLOAD_UPDATED", - "ST_LOGS SESSION OVERRIDE GET_USER_ID", - "ST_LOGS SESSION OVERRIDE GET_JWT_PAYLOAD_SECURELY", - ]), + "ST_LOGS SESSION ON_HANDLE_EVENT ACCESS_TOKEN_PAYLOAD_UPDATED", + "ST_LOGS SESSION OVERRIDE GET_USER_ID", + "ST_LOGS SESSION OVERRIDE GET_JWT_PAYLOAD_SECURELY", "ST_LOGS EMAIL_VERIFICATION OVERRIDE SEND_VERIFICATION_EMAIL", "ST_LOGS EMAIL_VERIFICATION PRE_API_HOOKS SEND_VERIFY_EMAIL", "ST_LOGS EMAIL_VERIFICATION ON_HANDLE_EVENT VERIFY_EMAIL_SENT", @@ -345,13 +341,9 @@ describe("SuperTokens Email Verification", function () { "ST_LOGS SESSION OVERRIDE GET_USER_ID", "ST_LOGS EMAIL_VERIFICATION OVERRIDE IS_EMAIL_VERIFIED", "ST_LOGS EMAIL_VERIFICATION PRE_API_HOOKS IS_EMAIL_VERIFIED", - ...(accountLinkingSupported - ? [] - : [ - "ST_LOGS SESSION ON_HANDLE_EVENT ACCESS_TOKEN_PAYLOAD_UPDATED", - "ST_LOGS SESSION OVERRIDE GET_USER_ID", - "ST_LOGS SESSION OVERRIDE GET_JWT_PAYLOAD_SECURELY", - ]), + "ST_LOGS SESSION ON_HANDLE_EVENT ACCESS_TOKEN_PAYLOAD_UPDATED", + "ST_LOGS SESSION OVERRIDE GET_USER_ID", + "ST_LOGS SESSION OVERRIDE GET_JWT_PAYLOAD_SECURELY", "ST_LOGS EMAIL_VERIFICATION OVERRIDE SEND_VERIFICATION_EMAIL", "ST_LOGS EMAIL_VERIFICATION PRE_API_HOOKS SEND_VERIFY_EMAIL", "ST_LOGS EMAIL_VERIFICATION ON_HANDLE_EVENT VERIFY_EMAIL_SENT", @@ -495,13 +487,9 @@ describe("SuperTokens Email Verification", function () { "ST_LOGS SESSION OVERRIDE GET_USER_ID", "ST_LOGS EMAIL_VERIFICATION OVERRIDE IS_EMAIL_VERIFIED", "ST_LOGS EMAIL_VERIFICATION PRE_API_HOOKS IS_EMAIL_VERIFIED", - ...(accountLinkingSupported - ? [] - : [ - "ST_LOGS SESSION ON_HANDLE_EVENT ACCESS_TOKEN_PAYLOAD_UPDATED", - "ST_LOGS SESSION OVERRIDE GET_USER_ID", - "ST_LOGS SESSION OVERRIDE GET_JWT_PAYLOAD_SECURELY", - ]), + "ST_LOGS SESSION ON_HANDLE_EVENT ACCESS_TOKEN_PAYLOAD_UPDATED", + "ST_LOGS SESSION OVERRIDE GET_USER_ID", + "ST_LOGS SESSION OVERRIDE GET_JWT_PAYLOAD_SECURELY", "ST_LOGS EMAIL_VERIFICATION OVERRIDE SEND_VERIFICATION_EMAIL", "ST_LOGS EMAIL_VERIFICATION PRE_API_HOOKS SEND_VERIFY_EMAIL", "ST_LOGS EMAIL_VERIFICATION ON_HANDLE_EVENT VERIFY_EMAIL_SENT", From 78dc12ef7df5ef20b8376c45c34f25725c82121d Mon Sep 17 00:00:00 2001 From: rishabhpoddar Date: Mon, 16 Oct 2023 17:53:17 +0530 Subject: [PATCH 02/12] adding dev-v0.35.6 tag to this commit to ensure building --- docs/classes/index.default.html | 2 +- docs/classes/recipe_authRecipe.default.html | 2 +- docs/classes/recipe_emailpassword.default.html | 2 +- docs/classes/recipe_emailverification.default.html | 2 +- docs/classes/recipe_multitenancy.default.html | 2 +- docs/classes/recipe_passwordless.default.html | 2 +- docs/classes/recipe_recipeModule.default.html | 2 +- docs/classes/recipe_session.BooleanClaim.html | 2 +- docs/classes/recipe_session.PrimitiveArrayClaim.html | 2 +- docs/classes/recipe_session.PrimitiveClaim.html | 2 +- docs/classes/recipe_session.default.html | 2 +- docs/classes/recipe_thirdparty.ActiveDirectory.html | 2 +- docs/classes/recipe_thirdparty.Apple.html | 2 +- docs/classes/recipe_thirdparty.Bitbucket.html | 2 +- docs/classes/recipe_thirdparty.BoxySAML.html | 2 +- docs/classes/recipe_thirdparty.Discord.html | 2 +- docs/classes/recipe_thirdparty.Facebook.html | 2 +- docs/classes/recipe_thirdparty.Github.html | 2 +- docs/classes/recipe_thirdparty.Gitlab.html | 2 +- docs/classes/recipe_thirdparty.Google.html | 2 +- docs/classes/recipe_thirdparty.GoogleWorkspaces.html | 2 +- docs/classes/recipe_thirdparty.LinkedIn.html | 2 +- docs/classes/recipe_thirdparty.Okta.html | 2 +- docs/classes/recipe_thirdparty.Twitter.html | 2 +- docs/classes/recipe_thirdparty.default.html | 2 +- docs/classes/recipe_thirdpartyemailpassword.default.html | 2 +- docs/classes/recipe_thirdpartypasswordless.default.html | 2 +- docs/classes/recipe_userroles.default.html | 2 +- docs/modules/index.html | 2 +- docs/modules/recipe_emailpassword.html | 4 ++-- docs/modules/recipe_emailverification.html | 4 ++-- docs/modules/recipe_multitenancy.html | 2 +- docs/modules/recipe_passwordless.html | 4 ++-- docs/modules/recipe_session.html | 4 ++-- docs/modules/recipe_thirdparty.html | 4 ++-- docs/modules/recipe_thirdpartyemailpassword.html | 4 ++-- docs/modules/recipe_thirdpartypasswordless.html | 4 ++-- 37 files changed, 44 insertions(+), 44 deletions(-) diff --git a/docs/classes/index.default.html b/docs/classes/index.default.html index 82d3e1d86..173857a19 100644 --- a/docs/classes/index.default.html +++ b/docs/classes/index.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

SuperTokensWrapper: FC<PropsWithChildren<{ userContext?: any }>> = SuperTokensWrapper
useTranslation: (() => TranslationFunc) = useTranslation

Type declaration

    • (): TranslationFunc
    • Returns TranslationFunc

useUserContext: (() => any) = useUserContext

Type declaration

    • (): any
    • Returns any

Methods

  • changeLanguage(language: string): Promise<void>
  • init(config: SuperTokensConfig): void
  • loadTranslation(store: TranslationStore): void
  • redirectToAuth(options?: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }): Promise<void>
  • Parameters

    • Optional options: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }
      • Optional history?: any
      • Optional queryParams?: any
      • Optional redirectBack?: boolean
      • Optional show?: "signin" | "signup"

    Returns Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

SuperTokensWrapper: FC<PropsWithChildren<{ userContext?: any }>> = SuperTokensWrapper
useTranslation: (() => TranslationFunc) = useTranslation

Type declaration

    • (): TranslationFunc
    • Returns TranslationFunc

useUserContext: (() => any) = useUserContext

Type declaration

    • (): any
    • Returns any

Methods

  • changeLanguage(language: string): Promise<void>
  • init(config: SuperTokensConfig): void
  • loadTranslation(store: TranslationStore): void
  • redirectToAuth(options?: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }): Promise<void>
  • Parameters

    • Optional options: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }
      • Optional history?: any
      • Optional queryParams?: any
      • Optional redirectBack?: boolean
      • Optional show?: "signin" | "signup"

    Returns Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

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 5c61e17b2..44ba99db0 100644 --- a/docs/classes/recipe_authRecipe.default.html +++ b/docs/classes/recipe_authRecipe.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<T, Action, R, N> Abstract

Type Parameters

  • T

  • Action

  • R

  • N extends NormalisedConfig<T | GetRedirectionURLContext, Action, R | OnHandleEventContext>

Hierarchy

  • default<T | GetRedirectionURLContext, Action, R | OnHandleEventContext, N>
    • default

Index

Constructors

  • new default<T, Action, R, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<T, Action, R, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • doesSessionExist(input?: { userContext?: any }): Promise<boolean>
  • getAuthRecipeDefaultRedirectionURL(context: GetRedirectionURLContext): Promise<string>
  • getDefaultRedirectionURL(_: GetRedirectionURLContext | T): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>
  • signOut(input?: { userContext?: any }): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property
  • Inherited method

Settings

Theme

Generated using TypeDoc

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

Class default<T, Action, R, N> Abstract

Type Parameters

  • T

  • Action

  • R

  • N extends NormalisedConfig<T | GetRedirectionURLContext, Action, R | OnHandleEventContext>

Hierarchy

  • default<T | GetRedirectionURLContext, Action, R | OnHandleEventContext, N>
    • default

Index

Constructors

  • new default<T, Action, R, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<T, Action, R, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • doesSessionExist(input?: { userContext?: any }): Promise<boolean>
  • getAuthRecipeDefaultRedirectionURL(context: GetRedirectionURLContext): Promise<string>
  • getDefaultRedirectionURL(_: GetRedirectionURLContext | T): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>
  • signOut(input?: { userContext?: any }): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property
  • Inherited method

Settings

Theme

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 8af5204ed..f06643696 100644 --- a/docs/classes/recipe_emailpassword.default.html +++ b/docs/classes/recipe_emailpassword.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

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

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

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

  • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

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

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

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

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

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

  • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

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

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

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 cebf38b3f..2796ce2f3 100644 --- a/docs/classes/recipe_emailverification.default.html +++ b/docs/classes/recipe_emailverification.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider
EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationRecipe.EmailVerificationClaim

Methods

  • getEmailVerificationTokenFromURL(input?: { userContext?: any }): string
  • isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>
  • Parameters

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

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

  • sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • Parameters

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

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

  • verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
  • Parameters

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider
EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationRecipe.EmailVerificationClaim

Methods

  • getEmailVerificationTokenFromURL(input?: { userContext?: any }): string
  • isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>
  • Parameters

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

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

  • sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • Parameters

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

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

  • verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
  • Parameters

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_multitenancy.default.html b/docs/classes/recipe_multitenancy.default.html index 0d0d54ec8..327c1b18e 100644 --- a/docs/classes/recipe_multitenancy.default.html +++ b/docs/classes/recipe_multitenancy.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

AllowedDomainsClaim: AllowedDomainsClaimClass = AllowedDomainsClaim
ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

AllowedDomainsClaim: AllowedDomainsClaimClass = AllowedDomainsClaim
ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_passwordless.default.html b/docs/classes/recipe_passwordless.default.html index 09e13751b..c8fb24fec 100644 --- a/docs/classes/recipe_passwordless.default.html +++ b/docs/classes/recipe_passwordless.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

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

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

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

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

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

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

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

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

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

    • CustomLoginAttemptInfoProperties

    Parameters

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

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

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

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

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

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

    • CustomStateProperties

    Parameters

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

    Returns Promise<void>

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

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

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

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

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

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

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

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

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

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

    • CustomLoginAttemptInfoProperties

    Parameters

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

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

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

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

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

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

    • CustomStateProperties

    Parameters

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

    Returns Promise<void>

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_recipeModule.default.html b/docs/classes/recipe_recipeModule.default.html index 887d8aba1..781934ba0 100644 --- a/docs/classes/recipe_recipeModule.default.html +++ b/docs/classes/recipe_recipeModule.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N> Abstract

Type Parameters

  • GetRedirectionURLContextType

  • Action

  • OnHandleEventContextType

  • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

Hierarchy

  • BaseRecipeModule<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Index

Constructors

  • new default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>
  • Type Parameters

    • GetRedirectionURLContextType

    • Action

    • OnHandleEventContextType

    • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

    Parameters

    • config: NormalisedConfigWithAppInfoAndRecipeID<N>

    Returns default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • getDefaultRedirectionURL(_: GetRedirectionURLContextType): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property

Settings

Theme

Generated using TypeDoc

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

Class default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N> Abstract

Type Parameters

  • GetRedirectionURLContextType

  • Action

  • OnHandleEventContextType

  • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

Hierarchy

  • BaseRecipeModule<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Index

Constructors

  • new default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>
  • Type Parameters

    • GetRedirectionURLContextType

    • Action

    • OnHandleEventContextType

    • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

    Parameters

    • config: NormalisedConfigWithAppInfoAndRecipeID<N>

    Returns default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • getDefaultRedirectionURL(_: GetRedirectionURLContextType): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_session.BooleanClaim.html b/docs/classes/recipe_session.BooleanClaim.html index 1a50cca3c..08f1262fd 100644 --- a/docs/classes/recipe_session.BooleanClaim.html +++ b/docs/classes/recipe_session.BooleanClaim.html @@ -1,3 +1,3 @@ -BooleanClaim | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • BooleanClaim
    • BooleanClaim

Index

Constructors

  • new BooleanClaim(config: PrimitiveClaimConfig & { onFailureRedirection?: ValidationFailureCallback; showAccessDeniedOnFailure?: boolean }): BooleanClaim
  • Parameters

    • config: PrimitiveClaimConfig & { onFailureRedirection?: ValidationFailureCallback; showAccessDeniedOnFailure?: boolean }

    Returns BooleanClaim

Properties

defaultMaxAgeInSeconds: undefined | number
id: string
refresh: ((userContext: any) => Promise<void>)

Type declaration

UserInput: { override?: { functions?: any } } & RecipeModuleUserInput<any, PreAndPostAPIHookAction, any>

Variables

AllowedDomainsClaim: AllowedDomainsClaimClass
MultitenancyComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

Functions

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

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 diff --git a/docs/modules/recipe_passwordless.html b/docs/modules/recipe_passwordless.html index 1da563268..a4cb7662a 100644 --- a/docs/modules/recipe_passwordless.html +++ b/docs/modules/recipe_passwordless.html @@ -1,4 +1,4 @@ -recipe/passwordless | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

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

Type declaration

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

Type declaration

  • clearLoginAttemptInfo:function
    • clearLoginAttemptInfo(input: { userContext: any }): Promise<void>
    • +recipe/passwordless | supertokens-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Type Aliases

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

      Type declaration

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

      Type declaration

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

          Parameters

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

          Returns Promise<void>

      • consumeCode:function
        • consumeCode(input: { deviceId: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any; userInputCode: string } | { linkCode: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
        • Log the user in using the input code or link code

          @@ -34,4 +34,4 @@

          Parameters

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

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

          {status: "OK"} if succesful

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

          -

          Type Parameters

          • CustomStateProperties

          Parameters

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

          Returns Promise<void>

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

      Variables

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

      Functions

      • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
      • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

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

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

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

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

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

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

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

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

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

        • CustomLoginAttemptInfoProperties

        Parameters

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

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

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

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

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

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

        • CustomStateProperties

        Parameters

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

        Returns Promise<void>

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

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

      Returns Promise<void>

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

Variables

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

Functions

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

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

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

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

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

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

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

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

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

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

    • CustomLoginAttemptInfoProperties

    Parameters

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

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

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

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

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

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

    • CustomStateProperties

    Parameters

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

    Returns Promise<void>

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

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 diff --git a/docs/modules/recipe_session.html b/docs/modules/recipe_session.html index ace6c1da7..7f6a58fef 100644 --- a/docs/modules/recipe_session.html +++ b/docs/modules/recipe_session.html @@ -1,8 +1,8 @@ -recipe/session | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

ClaimValidationError: { reason?: any; validatorId: string }

Type declaration

  • Optional reason?: any
  • validatorId: string
ClaimValidationResult: { isValid: true } | { isValid: false; reason?: any }
InputType: WebJSInputType & { accessDeniedScreen?: SessionFeatureBaseConfig; style?: string; onHandleEvent?: any }
RecipeInterface: { addAxiosInterceptors: any; addFetchInterceptorsAndReturnModifiedFetch: any; addXMLHttpRequestInterceptor: any; doesSessionExist: any; getAccessTokenPayloadSecurely: any; getGlobalClaimValidators: any; getInvalidClaimsFromResponse: any; getUserId: any; shouldDoInterceptionBasedOnUrl: any; signOut: any; validateClaims: any }

Type declaration

  • addAxiosInterceptors:function
    • addAxiosInterceptors(input: { axiosInstance: any; userContext: any }): void
    • Parameters

      • input: { axiosInstance: any; userContext: any }
        • axiosInstance: any
        • userContext: any

      Returns void

  • addFetchInterceptorsAndReturnModifiedFetch:function
    • addFetchInterceptorsAndReturnModifiedFetch(input: { originalFetch: any; userContext: any }): ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)
    • Parameters

      • input: { originalFetch: any; userContext: any }
        • originalFetch: any
        • userContext: any

      Returns ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)

        • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
        • Parameters

          • input: URL | RequestInfo
          • Optional init: RequestInit

          Returns Promise<Response>

  • addXMLHttpRequestInterceptor:function
    • addXMLHttpRequestInterceptor(input: { userContext: any }): void
    • Parameters

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

      Returns void

  • doesSessionExist:function
    • doesSessionExist(input: { userContext: any }): Promise<boolean>
    • Parameters

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

      Returns Promise<boolean>

  • getAccessTokenPayloadSecurely:function
    • getAccessTokenPayloadSecurely(input: { userContext: any }): Promise<any>
    • Parameters

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

      Returns Promise<any>

  • getGlobalClaimValidators:function
  • getInvalidClaimsFromResponse:function
    • getInvalidClaimsFromResponse(input: { response: { data: any } | Response; userContext: any }): Promise<ClaimValidationError[]>
    • Parameters

      • input: { response: { data: any } | Response; userContext: any }
        • response: { data: any } | Response
        • userContext: any

      Returns Promise<ClaimValidationError[]>

  • getUserId:function
    • getUserId(input: { userContext: any }): Promise<string>
    • Parameters

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

      Returns Promise<string>

  • shouldDoInterceptionBasedOnUrl:function
    • shouldDoInterceptionBasedOnUrl(toCheckUrl: string, apiDomain: string, sessionTokenBackendDomain: undefined | string): boolean
    • Parameters

      • toCheckUrl: string
      • apiDomain: string
      • sessionTokenBackendDomain: undefined | string

      Returns boolean

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

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

      Returns Promise<void>

  • validateClaims:function
SessionClaim<ValueType>: { getLastFetchedTime: any; getValueFromPayload: any; refresh: any }

Type Parameters

  • ValueType

Type declaration

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

      • payload: any
      • Optional _userContext: any

      Returns undefined | number

  • getValueFromPayload:function
    • getValueFromPayload(payload: any, _userContext?: any): undefined | ValueType
    • Parameters

      • payload: any
      • Optional _userContext: any

      Returns undefined | ValueType

  • refresh:function
    • refresh(userContext: any): Promise<void>
    • Parameters

      • userContext: any

      Returns Promise<void>

SessionClaimValidator: { id: string; refresh: any; shouldRefresh: any; validate: any }

Type declaration

  • Readonly id: string
  • refresh:function
    • refresh(userContext: any): Promise<void>
    • +recipe/session | supertokens-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Type Aliases

      ClaimValidationError: { reason?: any; validatorId: string }

      Type declaration

      • Optional reason?: any
      • validatorId: string
      ClaimValidationResult: { isValid: true } | { isValid: false; reason?: any }
      InputType: WebJSInputType & { accessDeniedScreen?: SessionFeatureBaseConfig; style?: string; onHandleEvent?: any }
      RecipeInterface: { addAxiosInterceptors: any; addFetchInterceptorsAndReturnModifiedFetch: any; addXMLHttpRequestInterceptor: any; doesSessionExist: any; getAccessTokenPayloadSecurely: any; getGlobalClaimValidators: any; getInvalidClaimsFromResponse: any; getUserId: any; shouldDoInterceptionBasedOnUrl: any; signOut: any; validateClaims: any }

      Type declaration

      • addAxiosInterceptors:function
        • addAxiosInterceptors(input: { axiosInstance: any; userContext: any }): void
        • Parameters

          • input: { axiosInstance: any; userContext: any }
            • axiosInstance: any
            • userContext: any

          Returns void

      • addFetchInterceptorsAndReturnModifiedFetch:function
        • addFetchInterceptorsAndReturnModifiedFetch(input: { originalFetch: any; userContext: any }): ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)
        • Parameters

          • input: { originalFetch: any; userContext: any }
            • originalFetch: any
            • userContext: any

          Returns ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)

            • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
            • Parameters

              • input: URL | RequestInfo
              • Optional init: RequestInit

              Returns Promise<Response>

      • addXMLHttpRequestInterceptor:function
        • addXMLHttpRequestInterceptor(input: { userContext: any }): void
        • Parameters

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

          Returns void

      • doesSessionExist:function
        • doesSessionExist(input: { userContext: any }): Promise<boolean>
        • Parameters

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

          Returns Promise<boolean>

      • getAccessTokenPayloadSecurely:function
        • getAccessTokenPayloadSecurely(input: { userContext: any }): Promise<any>
        • Parameters

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

          Returns Promise<any>

      • getGlobalClaimValidators:function
      • getInvalidClaimsFromResponse:function
        • getInvalidClaimsFromResponse(input: { response: { data: any } | Response; userContext: any }): Promise<ClaimValidationError[]>
        • Parameters

          • input: { response: { data: any } | Response; userContext: any }
            • response: { data: any } | Response
            • userContext: any

          Returns Promise<ClaimValidationError[]>

      • getUserId:function
        • getUserId(input: { userContext: any }): Promise<string>
        • Parameters

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

          Returns Promise<string>

      • shouldDoInterceptionBasedOnUrl:function
        • shouldDoInterceptionBasedOnUrl(toCheckUrl: string, apiDomain: string, sessionTokenBackendDomain: undefined | string): boolean
        • Parameters

          • toCheckUrl: string
          • apiDomain: string
          • sessionTokenBackendDomain: undefined | string

          Returns boolean

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

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

          Returns Promise<void>

      • validateClaims:function
      SessionClaim<ValueType>: { getLastFetchedTime: any; getValueFromPayload: any; refresh: any }

      Type Parameters

      • ValueType

      Type declaration

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

          • payload: any
          • Optional _userContext: any

          Returns undefined | number

      • getValueFromPayload:function
        • getValueFromPayload(payload: any, _userContext?: any): undefined | ValueType
        • Parameters

          • payload: any
          • Optional _userContext: any

          Returns undefined | ValueType

      • refresh:function
        • refresh(userContext: any): Promise<void>
        • Parameters

          • userContext: any

          Returns Promise<void>

      SessionClaimValidator: { id: string; refresh: any; shouldRefresh: any; validate: any }

      Type declaration

      • Readonly id: string
      • refresh:function
        • refresh(userContext: any): Promise<void>
        • Makes an API call that will refresh the claim in the token.

          Parameters

          • userContext: any

          Returns Promise<void>

      • shouldRefresh:function
        • shouldRefresh(accessTokenPayload: any, userContext: any): boolean | Promise<boolean>
        • Decides if we need to refresh the claim value before checking the payload with validate. E.g.: if the information in the payload is expired, or is not sufficient for this validator.

          Parameters

          • accessTokenPayload: any
          • userContext: any

          Returns boolean | Promise<boolean>

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

      SessionContextType: LoadedSessionContext | { loading: true }

      Variables

      SessionAuth: FC<PropsWithChildren<SessionAuthProps & { userContext?: any }>> = SessionAPIWrapper.SessionAuth
      SessionComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = SessionAPIWrapper.ComponentsOverrideProvider
      SessionContext: Context<{ accessDeniedValidatorError?: ClaimValidationError; invalidClaims: ClaimValidationError[]; loading: false } & SessionContextUpdate & { isDefault?: boolean } & { loading: true } & { isDefault?: boolean }> = ...

      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?: InputType): RecipeInitResult<unknown, unknown, unknown, any>
      • signOut(input?: { userContext?: any }): Promise<void>
      • useClaimValue<T>(claim: SessionClaim<T>): { loading: true } | { doesSessionExist: boolean; loading: false; value: undefined | T }

      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 +

      Parameters

      • accessTokenPayload: any
      • userContext: any

      Returns ClaimValidationResult | Promise<ClaimValidationResult>

SessionContextType: LoadedSessionContext | { loading: true }

Variables

SessionAuth: FC<PropsWithChildren<SessionAuthProps & { userContext?: any }>> = SessionAPIWrapper.SessionAuth
SessionComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = SessionAPIWrapper.ComponentsOverrideProvider
SessionContext: Context<{ accessDeniedValidatorError?: ClaimValidationError; invalidClaims: ClaimValidationError[]; loading: false } & SessionContextUpdate & { isDefault?: boolean } & { loading: true } & { isDefault?: boolean }> = ...

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?: InputType): RecipeInitResult<unknown, unknown, unknown, any>
  • signOut(input?: { userContext?: any }): Promise<void>
  • useClaimValue<T>(claim: SessionClaim<T>): { loading: true } | { doesSessionExist: boolean; loading: false; value: undefined | T }

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 diff --git a/docs/modules/recipe_thirdparty.html b/docs/modules/recipe_thirdparty.html index 211b44f03..cb74e2589 100644 --- a/docs/modules/recipe_thirdparty.html +++ b/docs/modules/recipe_thirdparty.html @@ -1,4 +1,4 @@ -recipe/thirdparty | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

GetRedirectionURLContext: AuthRecipeModuleGetRedirectionURLContext
OnHandleEventContext: AuthRecipeModuleOnHandleEventContext | { action: "SUCCESS"; isNewRecipeUser: boolean; user: User; userContext: any }
PreAPIHookContext: { action: PreAndPostAPIHookAction; requestInit: RequestInit; url: string; userContext: any }

Type declaration

  • action: PreAndPostAPIHookAction
  • requestInit: RequestInit
  • url: string
  • userContext: any
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-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Type Aliases

      GetRedirectionURLContext: AuthRecipeModuleGetRedirectionURLContext
      OnHandleEventContext: AuthRecipeModuleOnHandleEventContext | { action: "SUCCESS"; isNewRecipeUser: boolean; user: User; userContext: any }
      PreAPIHookContext: { action: PreAndPostAPIHookAction; requestInit: RequestInit; url: string; userContext: any }

      Type declaration

      • action: PreAndPostAPIHookAction
      • requestInit: RequestInit
      • url: string
      • userContext: any
      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
        • @@ -26,4 +26,4 @@

          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

      • 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: { oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

      Variables

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

      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
      • Type Parameters

        • CustomStateProperties

        Parameters

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

        Returns undefined | StateObject & CustomStateProperties

      • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
      • Parameters

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

        Returns Promise<{ status: "OK" | "ERROR" }>

      • 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

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

        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>

UserInput: { oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

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

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
  • Type Parameters

    • CustomStateProperties

    Parameters

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

    Returns undefined | StateObject & CustomStateProperties

  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
  • Parameters

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

    Returns Promise<{ status: "OK" | "ERROR" }>

  • 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

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

    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 diff --git a/docs/modules/recipe_thirdpartyemailpassword.html b/docs/modules/recipe_thirdpartyemailpassword.html index 75616e607..c898aadc1 100644 --- a/docs/modules/recipe_thirdpartyemailpassword.html +++ b/docs/modules/recipe_thirdpartyemailpassword.html @@ -1,4 +1,4 @@ -recipe/thirdpartyemailpassword | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/thirdpartyemailpassword

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: { 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-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Module recipe/thirdpartyemailpassword

      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: { 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" }>
        • Check if an 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}

          @@ -51,4 +51,4 @@

          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

      • 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: { disableEmailPassword?: boolean; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; resetPasswordUsingTokenFeature?: ResetPasswordUsingTokenUserInput; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

      Variables

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

      Functions

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

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

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

      • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
      • getStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
      • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
      • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "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" }>
      • Parameters

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

        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: { disableEmailPassword?: boolean; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; resetPasswordUsingTokenFeature?: ResetPasswordUsingTokenUserInput; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

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

Functions

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

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

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

  • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
  • getStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "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" }>
  • Parameters

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

    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 diff --git a/docs/modules/recipe_thirdpartypasswordless.html b/docs/modules/recipe_thirdpartypasswordless.html index 3b5858364..3d83fa41c 100644 --- a/docs/modules/recipe_thirdpartypasswordless.html +++ b/docs/modules/recipe_thirdpartypasswordless.html @@ -1,4 +1,4 @@ -recipe/thirdpartypasswordless | supertokens-auth-react
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>
    • +recipe/thirdpartypasswordless | supertokens-auth-react
      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

          @@ -62,4 +62,4 @@

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

      Variables

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

      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

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

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

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

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

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

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

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

        Returns 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 } & CustomLoginAttemptInfoProperties>
      • Type Parameters

        • CustomLoginAttemptInfoProperties

        Parameters

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

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

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

      • getThirdPartyStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
      • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
      • resendPasswordlessCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
      • Parameters

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

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

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

        • CustomStateProperties

        Parameters

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

        Returns Promise<void>

      • signOut(input?: { userContext?: any }): Promise<void>
      • thirdPartySignInAndUp(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

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

        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: ({ 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; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any } } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

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

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

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

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

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

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

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

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

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

    Returns 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 } & CustomLoginAttemptInfoProperties>
  • Type Parameters

    • CustomLoginAttemptInfoProperties

    Parameters

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

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

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

  • getThirdPartyStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
  • resendPasswordlessCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
  • Parameters

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

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

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

    • CustomStateProperties

    Parameters

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

    Returns Promise<void>

  • signOut(input?: { userContext?: any }): Promise<void>
  • thirdPartySignInAndUp(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

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

    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 From 41be7648847ab9d8578f3e086d5b3a46bf9176ef Mon Sep 17 00:00:00 2001 From: Rishabh Poddar Date: Thu, 23 Nov 2023 15:11:31 +0530 Subject: [PATCH 03/12] Custom form fields (#760) * feat: add input component as types, simplify event handlers - emailpassword recipe (#752) * Add inputComponent to exposed types * Add inputComponent to normalised fields * For testing only - use custom type definition for inputComponent * Input component already present in FormFieldThemeProps * Testing if git package is getting installed correctly * Run build for previous commits * Remove inputComp from NormalizedFormField * Add tests for custom fields * Remove testing ele * Move the custom fields tests into existing describe * Update dropdown values to avoid confusion * Add helper func to set dropdown, better test title, use existing describe hooks * Use strict equal * Update request * A seperate func to fetch custom comp not required * Move inputComponent to signup types * Cleanup unwanted imports * Move inputComponent to signup types * Clean types * Update build files * Use explicit values in validate func * Minor cleanup of types * Better type names * Props suggestions working for inputComponent * Enforce strict string check on form values, now onChange function for fields only needs value, no need to supply name or id * Update based on the new onChange func * Ability to add default value with getDefaultValue prop * Handle if getDefaultValue is not a function * instead of form submit apply type test within onChange function itself * Add tests for default value * Remove unwanted abort * Testing email-verification workflow * Reverting onChange changes * onChange function to accept only values * Initialize fieldstates at the start * Remove useEffect * Fix race conditions when setting default value * Add custom default fields to typescript example, plus add tests to show custom error message * Add tests for incorrect default props in formFields * Add tests for incorrect usage of onChange prop * Add change log * Wrap ternary opeators into seperate func for better readibility * Wrap inputComponent in a serperate component to avoid unecessary rerenders * Add change log feedbacks * Better variable names, include formfields directly in typescript example * Add more tests for default & onChange func, updated typescript file to show the latest changes * Add more test, which intercepts request payload * Cleanup comments * Minor formatting * Minor fix * Clean up helper * Update change log & versions * feat: add getDefaultValue to signin & signup form fields (#756) * Add getDefaultValue to signin, hence shuffle the existing types * Add tests for default signin feature * Add default feature to typescript * Fix failed test * Reset password now supports getDefaultValue * Add tests for resetPassword email field * Revert "Add tests for resetPassword email field" This reverts commit 363b575b7251bac02b250dc6e6965d39a8d68e4a. * Revert "Reset password now supports getDefaultValue" This reverts commit be4c00a024401d093a5b80033a6c3e7ea9839cb1. * feat: add nonOptionalErrorMsg props (#757) * Add nonOptionalErr types * Now supports nonOptionalErrorMsg attribute * Add tests and fix signin types to include nonOptionalMsg * Enforce no api request are made on blank forms * Clean up signup * Throw error if invalid nonOptionalErrorMsg, add tests for the same * Better error message * Handle incorrect optional flag * fixes redundant normalisation --------- Co-authored-by: rishabhpoddar * Add test for thirdparty signup - new features * Add tests for thirdparty signin - new features * Run build-pretty * Set correct flag * fix: display required indicator only for non-empty labels and Improve test structure (#762) * Show required sign only if label is valid * Better func names & consistent return type * Use assert instead of throw error * Consistent tests description * Remove unecessary code * Add correct version number * Update changelog, add thirdparty example * Minor fox * Read from testContext * Refactor tests to ensure its easy to maintain different configurations * Update third party tests * Clean up * Minor copy update * Trim the label text * Add build * Handle if label is not supplied * Highlight var in changelog, minor update * Update custom payload to test for trimmed-version label * Use page.select for changing dropdown values * Handle react 16 tests for new features (#764) --------- Co-authored-by: Amit Badala --- CHANGELOG.md | 75 +++ examples/for-tests/src/App.js | 223 +++++++- examples/for-tests/src/testContext.js | 4 + lib/build/emailpassword-shared4.js | 7 + lib/build/emailpassword-shared7.js | 187 ++++-- lib/build/passwordless-shared3.js | 20 +- .../components/library/input.d.ts | 7 +- .../resetPasswordEmail.d.ts | 2 +- .../submitNewPassword.d.ts | 2 +- .../components/themes/signInAndUp/signIn.d.ts | 2 +- .../themes/signInAndUp/signInForm.d.ts | 2 +- .../components/themes/signInAndUp/signUp.d.ts | 5 +- .../themes/signInAndUp/signUpForm.d.ts | 5 +- lib/build/recipe/emailpassword/types.d.ts | 26 +- lib/build/types.d.ts | 4 + lib/build/version.d.ts | 2 +- .../components/library/formBase.tsx | 155 +++-- .../components/library/input.tsx | 22 +- .../components/library/label.tsx | 2 +- lib/ts/recipe/emailpassword/types.ts | 41 +- lib/ts/recipe/emailpassword/utils.ts | 7 + .../themes/signInUp/phoneNumberInput.tsx | 20 +- lib/ts/types.ts | 20 + lib/ts/version.ts | 2 +- package-lock.json | 487 +--------------- package.json | 2 +- test/end-to-end/signin.test.js | 132 +++++ test/end-to-end/signup.test.js | 435 ++++++++++++++ .../thirdpartyemailpassword.test.js | 531 ++++++++++++++++++ test/helpers.js | 5 + test/with-typescript/src/App.tsx | 180 ++++++ 31 files changed, 1927 insertions(+), 687 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce869efbd..1c84f6e6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,81 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) +## [0.35.7] - 2023-11-16 + +### Added + +- EmailPassword and ThirdPartyEmailPassword recipe enhancements: + - Introduced the capability to utilize custom components by exposing `inputComponent` types. + - Allow setting default values in signup/signin form fields. + - Made the `onChange` prop in `inputComponent` simpler by removing the need for an `id` attribute. + - Added a feature to customize the "Field is not optional" error message for each form field with the `nonOptionalErrorMsg` prop. + +Following is an example of how to use above features. + +```tsx +EmailPassword.init({ + signInAndUpFeature: { + signUpForm: { + formFields: [ + { + id: "select-dropdown", + label: "Select Option", + getDefaultValue: () => "option 2", + nonOptionalErrorMsg: "Select dropdown is required", + inputComponent: ({ value, name, onChange }) => ( + + ), + }, + ], + }, + }, +}); + +ThirdPartyEmailPassword.init({ + signInAndUpFeature: { + signUpForm: { + formFields: [ + { + id: "terms", + label: "", + optional: false, + getDefaultValue: () => "true", + nonOptionalErrorMsg: "You must accept the terms and conditions", + inputComponent: ({ name, onChange, value }) => ( +
+ onChange(e.target.checked.toString())}> + I agree to the terms and conditions +
+ ), + }, + ], + }, + }, +}); +``` + ## [0.35.6] - 2023-10-16 ### Test changes diff --git a/examples/for-tests/src/App.js b/examples/for-tests/src/App.js index f65dac002..add8541e8 100644 --- a/examples/for-tests/src/App.js +++ b/examples/for-tests/src/App.js @@ -168,6 +168,167 @@ const formFields = [ }, ]; +const formFieldsWithDefault = [ + { + id: "country", + label: "Your Country", + placeholder: "Where do you live?", + optional: true, + getDefaultValue: () => "India", + }, + { + id: "select-dropdown", + label: "Select Option", + getDefaultValue: () => "option 2", + inputComponent: ({ value, name, onChange }) => ( + + ), + optional: true, + }, + { + id: "terms", + label: "", + optional: false, + getDefaultValue: () => "true", + inputComponent: ({ name, onChange, value }) => ( +
+ onChange(e.target.checked.toString())}> + I agree to the terms and conditions +
+ ), + validate: async (value) => { + if (value === "true") { + return undefined; + } + return "Please check Terms and conditions"; + }, + }, + { + id: "email", + label: "Email", + getDefaultValue: () => "test@one.com", + }, + { + id: "password", + label: "Password", + getDefaultValue: () => "fakepassword123", + }, +]; + +const incorrectFormFields = [ + { + id: "country", + label: "Your Country", + placeholder: "Where do you live?", + optional: true, + getDefaultValue: () => 23, // return should be a string + }, + { + id: "select-dropdown", + label: "Select Dropdown", + getDefaultValue: "option 2", // should be function + inputComponent: ({ value, name, onChange }) => ( + + ), + optional: true, + }, + { + // onChange accepts only string value, here we pass boolean + id: "terms", + label: "", + optional: false, + inputComponent: ({ name, onChange }) => ( +
+ onChange(e.target.checked)}> + I agree to the terms and conditions +
+ ), + validate: async (value) => { + if (value === "true") { + return undefined; + } + return "Please check Terms and conditions"; + }, + }, + { + id: "city", + label: "Your city", + optional: false, + nonOptionalErrorMsg: "", // empty string should throw error + }, +]; + +const customFields = [ + { + id: "select-dropdown", + label: "Select Dropdown", + nonOptionalErrorMsg: "Select dropdown is not an optional", + inputComponent: ({ value, name, onChange }) => ( + + ), + optional: true, + }, + { + id: "terms", + label: " ", + optional: false, + nonOptionalErrorMsg: "You must accept the terms and conditions", + inputComponent: ({ name, onChange }) => ( +
+ onChange(e.target.checked.toString())}> + I agree to the terms and conditions +
+ ), + validate: async (value) => { + if (value === "true") { + return undefined; + } + return "Please check Terms and conditions"; + }, + }, +]; + const testContext = getTestContext(); let recipeList = [ @@ -552,7 +713,51 @@ function getEmailVerificationConfigs({ disableDefaultUI }) { }); } -function getEmailPasswordConfigs({ disableDefaultUI }) { +function getSignUpFormFields(formType) { + switch (formType) { + case "INCORRECT_FIELDS": + return incorrectFormFields; + case "INCORRECT_ONCHANGE": + return incorrectFormFields.filter(({ id }) => id === "terms"); + case "INCORRECT_NON_OPTIONAL_ERROR_MSG": + return incorrectFormFields.filter(({ id }) => id === "city"); + case "INCORRECT_GETDEFAULT": + return incorrectFormFields.filter(({ id }) => id === "country"); + case "CUSTOM_FIELDS_WITH_DEFAULT_VALUES": + return formFieldsWithDefault; + case "CUSTOM_FIELDS": + return customFields; + default: + return formFields; + } +} + +function getSignInFormFields(formType) { + switch (formType) { + case "DEFAULT_FIELDS": + return [ + { + id: "email", + getDefaultValue: () => "abc@xyz.com", + }, + { + id: "password", + getDefaultValue: () => "fakepassword123", + }, + ]; + case "FIELDS_WITH_NON_OPTIONAL_ERROR_MESSAGE": + return [ + { + id: "email", + nonOptionalErrorMsg: "Please add email", + }, + ]; + default: + return; + } +} + +function getEmailPasswordConfigs({ disableDefaultUI, formFieldType }) { return EmailPassword.init({ style: ` [data-supertokens~=container] { @@ -632,12 +837,13 @@ function getEmailPasswordConfigs({ disableDefaultUI }) { defaultToSignUp, signInForm: { style: theme, + formFields: getSignInFormFields(formFieldType.signIn), }, signUpForm: { style: theme, privacyPolicyLink: "https://supertokens.com/legal/privacy-policy", termsOfServiceLink: "https://supertokens.com/legal/terms-and-conditions", - formFields, + formFields: getSignUpFormFields(formFieldType.signUp), }, }, }); @@ -981,7 +1187,12 @@ function getThirdPartyConfigs({ staticProviderList, disableDefaultUI, thirdParty }); } -function getThirdPartyEmailPasswordConfigs({ staticProviderList, disableDefaultUI, thirdPartyRedirectURL }) { +function getThirdPartyEmailPasswordConfigs({ + staticProviderList, + disableDefaultUI, + thirdPartyRedirectURL, + formFieldType, +}) { let providers = [ ThirdParty.Github.init(), ThirdParty.Google.init(), @@ -1160,9 +1371,11 @@ function getThirdPartyEmailPasswordConfigs({ staticProviderList, disableDefaultU }, signInAndUpFeature: { disableDefaultUI, - signInForm: {}, + signInForm: { + formFields: getSignInFormFields(formFieldType.signIn), + }, signUpForm: { - formFields, + formFields: getSignUpFormFields(formFieldType.signUp), privacyPolicyLink: "https://supertokens.com/legal/privacy-policy", termsOfServiceLink: "https://supertokens.com/legal/terms-and-conditions", }, diff --git a/examples/for-tests/src/testContext.js b/examples/for-tests/src/testContext.js index 618e990ba..3021a9b92 100644 --- a/examples/for-tests/src/testContext.js +++ b/examples/for-tests/src/testContext.js @@ -14,6 +14,10 @@ export function getTestContext() { staticProviderList: localStorage.getItem("staticProviderList"), mockTenantId: localStorage.getItem("mockTenantId"), clientType: localStorage.getItem("clientType") || undefined, + formFieldType: { + signIn: localStorage.getItem("SIGNIN_SETTING_TYPE"), + signUp: localStorage.getItem("SIGNUP_SETTING_TYPE"), + }, }; return ret; } diff --git a/lib/build/emailpassword-shared4.js b/lib/build/emailpassword-shared4.js index e3070936a..e2f54ebcc 100644 --- a/lib/build/emailpassword-shared4.js +++ b/lib/build/emailpassword-shared4.js @@ -376,6 +376,10 @@ function mergeFormFields(defaultFormFields, userFormFields) { } function getFormattedFormField(field) { var _this = this; + // Fields with the 'nonOptionalErrorMsg' property must have a valid message defined + if (field.optional === false && field.nonOptionalErrorMsg === "") { + throw new Error("nonOptionalErrorMsg for field ".concat(field.id, " cannot be an empty string")); + } return genericComponentOverrideContext.__assign(genericComponentOverrideContext.__assign({}, field), { validate: function (value) { return genericComponentOverrideContext.__awaiter(_this, void 0, void 0, function () { @@ -384,6 +388,9 @@ function getFormattedFormField(field) { case 0: // Absent or not optional empty field if (value === "" && field.optional === false) { + if (field.nonOptionalErrorMsg !== undefined) { + return [2 /*return*/, field.nonOptionalErrorMsg]; + } return [2 /*return*/, "ERROR_NON_OPTIONAL"]; } return [4 /*yield*/, field.validate(value)]; diff --git a/lib/build/emailpassword-shared7.js b/lib/build/emailpassword-shared7.js index 6415dc169..e48dc5334 100644 --- a/lib/build/emailpassword-shared7.js +++ b/lib/build/emailpassword-shared7.js @@ -320,26 +320,17 @@ var Input = function (_a) { */ function handleFocus() { if (onInputFocus !== undefined) { - onInputFocus({ - id: name, - value: value, - }); + onInputFocus(value); } } function handleBlur() { if (onInputBlur !== undefined) { - onInputBlur({ - id: name, - value: value, - }); + onInputBlur(value); } } function handleChange(event) { if (onChange) { - onChange({ - id: name, - value: event.target.value, - }); + onChange(event.target.value); } } if (autoComplete === undefined) { @@ -434,11 +425,84 @@ function Label(_a) { "div", genericComponentOverrideContext.__assign( { "data-supertokens": "label" }, - { children: [t(value), showIsRequired && " *"] } + { children: [t(value), showIsRequired && value && value.trim() !== "" && " *"] } ) ); } +var fetchDefaultValue = function (field) { + if (field.getDefaultValue !== undefined) { + var defaultValue = field.getDefaultValue(); + if (typeof defaultValue !== "string") { + throw new Error("getDefaultValue for ".concat(field.id, " must return a string")); + } else { + return defaultValue; + } + } + return ""; +}; +function InputComponentWrapper(props) { + var field = props.field, + type = props.type, + fstate = props.fstate, + onInputFocus = props.onInputFocus, + onInputBlur = props.onInputBlur, + onInputChange = props.onInputChange; + var useCallbackOnInputFocus = React.useCallback( + function (value) { + onInputFocus({ + id: field.id, + value: value, + }); + }, + [onInputFocus, field] + ); + var useCallbackOnInputBlur = React.useCallback( + function (value) { + onInputBlur({ + id: field.id, + value: value, + }); + }, + [onInputBlur, field] + ); + var useCallbackOnInputChange = React.useCallback( + function (value) { + onInputChange({ + id: field.id, + value: value, + }); + }, + [onInputChange, field] + ); + return field.inputComponent !== undefined + ? jsxRuntime.jsx(field.inputComponent, { + type: type, + name: field.id, + validated: fstate.validated === true, + placeholder: field.placeholder, + value: fstate.value, + autoComplete: field.autoComplete, + autofocus: field.autofocus, + onInputFocus: useCallbackOnInputFocus, + onInputBlur: useCallbackOnInputBlur, + onChange: useCallbackOnInputChange, + hasError: fstate.error !== undefined, + }) + : jsxRuntime.jsx(Input, { + type: type, + name: field.id, + validated: fstate.validated === true, + placeholder: field.placeholder, + value: fstate.value, + autoComplete: field.autoComplete, + onInputFocus: useCallbackOnInputFocus, + onInputBlur: useCallbackOnInputBlur, + onChange: useCallbackOnInputChange, + autofocus: field.autofocus, + hasError: fstate.error !== undefined, + }); +} var FormBase = function (props) { var footer = props.footer, buttonLabel = props.buttonLabel, @@ -458,7 +522,7 @@ var FormBase = function (props) { ); var _a = React.useState( props.formFields.map(function (f) { - return { id: f.id, value: "" }; + return { id: f.id, value: fetchDefaultValue(f) }; }) ), fieldStates = _a[0], @@ -536,6 +600,9 @@ var FormBase = function (props) { ); var onInputChange = React.useCallback( function (field) { + if (typeof field.value !== "string") { + throw new Error("".concat(field.id, " value must be a string")); + } updateFieldState(field.id, function (os) { return genericComponentOverrideContext.__assign(genericComponentOverrideContext.__assign({}, os), { value: field.value, @@ -549,7 +616,17 @@ var FormBase = function (props) { var onFormSubmit = React.useCallback( function (e) { return genericComponentOverrideContext.__awaiter(void 0, void 0, void 0, function () { - var apiFields, fieldUpdates, result, generalError, e_1, _loop_1, _i, formFields_1, field, errorFields_1; + var apiFields, + fieldUpdates, + result, + generalError, + e_1, + _loop_1, + _i, + formFields_1, + field, + errorFields_1, + getErrorMessage_1; return genericComponentOverrideContext.__generator(this, function (_a) { switch (_a.label) { case 0: @@ -639,19 +716,36 @@ var FormBase = function (props) { // If field error. if (result.status === "FIELD_ERROR") { errorFields_1 = result.formFields; + getErrorMessage_1 = function (fs) { + var _a; + var errorMessage = + (_a = errorFields_1.find(function (ef) { + return ef.id === fs.id; + })) === null || _a === void 0 + ? void 0 + : _a.error; + if (errorMessage === "Field is not optional") { + var fieldConfigData = props.formFields.find(function (f) { + return f.id === fs.id; + }); + // replace non-optional server error message from nonOptionalErrorMsg + if ( + (fieldConfigData === null || fieldConfigData === void 0 + ? void 0 + : fieldConfigData.nonOptionalErrorMsg) !== undefined + ) { + return fieldConfigData === null || fieldConfigData === void 0 + ? void 0 + : fieldConfigData.nonOptionalErrorMsg; + } + } + return errorMessage; + }; setFieldStates(function (os) { return os.map(function (fs) { - var _a; return genericComponentOverrideContext.__assign( genericComponentOverrideContext.__assign({}, fs), - { - error: - (_a = errorFields_1.find(function (ef) { - return ef.id === fs.id; - })) === null || _a === void 0 - ? void 0 - : _a.error, - } + { error: getErrorMessage_1(fs) } ); }); }); @@ -690,12 +784,10 @@ var FormBase = function (props) { } var fstate = fieldStates.find(function (s) { return s.id === field.id; - }) || { - id: field.id, - validated: false, - error: undefined, - value: "", - }; + }); + if (fstate === undefined) { + throw new Error("Should never come here"); + } return jsxRuntime.jsx( FormRow, genericComponentOverrideContext.__assign( @@ -710,33 +802,14 @@ var FormBase = function (props) { value: field.label, showIsRequired: field.showIsRequired, })), - field.inputComponent !== undefined - ? jsxRuntime.jsx(field.inputComponent, { - type: type, - name: field.id, - validated: fstate.validated === true, - placeholder: field.placeholder, - value: fstate.value, - autoComplete: field.autoComplete, - autofocus: field.autofocus, - onInputFocus: onInputFocus, - onInputBlur: onInputBlur, - onChange: onInputChange, - hasError: fstate.error !== undefined, - }) - : jsxRuntime.jsx(Input, { - type: type, - name: field.id, - validated: fstate.validated === true, - placeholder: field.placeholder, - value: fstate.value, - autoComplete: field.autoComplete, - onInputFocus: onInputFocus, - onInputBlur: onInputBlur, - onChange: onInputChange, - autofocus: field.autofocus, - hasError: fstate.error !== undefined, - }), + jsxRuntime.jsx(InputComponentWrapper, { + type: type, + field: field, + fstate: fstate, + onInputFocus: onInputFocus, + onInputBlur: onInputBlur, + onInputChange: onInputChange, + }), fstate.error && jsxRuntime.jsx(InputError, { error: fstate.error }), ], }), diff --git a/lib/build/passwordless-shared3.js b/lib/build/passwordless-shared3.js index 54b23e5a7..73e421acf 100644 --- a/lib/build/passwordless-shared3.js +++ b/lib/build/passwordless-shared3.js @@ -2569,18 +2569,12 @@ function PhoneNumberInput(_a) { value = _a.value; function handleFocus() { if (onInputFocus !== undefined) { - onInputFocus({ - id: name, - value: value, - }); + onInputFocus(value); } } function handleBlur() { if (onInputBlur !== undefined) { - onInputBlur({ - id: name, - value: value, - }); + onInputBlur(value); } } var _b = React.useState(), @@ -2596,10 +2590,7 @@ function PhoneNumberInput(_a) { var handleChange = React.useCallback( function (newValue) { if (onChangeRef.current !== undefined) { - onChangeRef.current({ - id: name, - value: newValue, - }); + onChangeRef.current(newValue); } }, [onChangeRef] @@ -2607,10 +2598,7 @@ function PhoneNumberInput(_a) { var handleCountryChange = React.useCallback( function (ev) { if (onChangeRef.current !== undefined && phoneInputInstance !== undefined) { - onChangeRef.current({ - id: name, - value: ev.target.value, - }); + onChangeRef.current(ev.target.value); } }, [onChangeRef] diff --git a/lib/build/recipe/emailpassword/components/library/input.d.ts b/lib/build/recipe/emailpassword/components/library/input.d.ts index 44893e14a..973042e7c 100644 --- a/lib/build/recipe/emailpassword/components/library/input.d.ts +++ b/lib/build/recipe/emailpassword/components/library/input.d.ts @@ -1,5 +1,4 @@ /// -import type { APIFormField } from "../../../../types"; export declare type InputProps = { type: string; name: string; @@ -9,9 +8,9 @@ export declare type InputProps = { hasError: boolean; placeholder: string; value: string; - onInputBlur?: (field: APIFormField) => void; - onInputFocus?: (field: APIFormField) => void; - onChange?: (field: APIFormField) => void; + onInputBlur?: (value: string) => void; + onInputFocus?: (value: string) => void; + onChange?: (value: string) => void; }; declare const Input: React.FC; export default Input; diff --git a/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/resetPasswordEmail.d.ts b/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/resetPasswordEmail.d.ts index 8ff8a9b05..bcc6e2b05 100644 --- a/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/resetPasswordEmail.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/resetPasswordEmail.d.ts @@ -1,7 +1,7 @@ /// export declare const ResetPasswordEmail: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { - formFields: import("../../../types").FormFieldThemeProps[]; + formFields: Omit[]; error: string | undefined; } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; diff --git a/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts b/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts index b8ec36fd7..9c795dce2 100644 --- a/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts @@ -1,7 +1,7 @@ /// export declare const SubmitNewPassword: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { - formFields: import("../../../types").FormFieldThemeProps[]; + formFields: Omit[]; error: string | undefined; } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; diff --git a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts index 2b40c960b..64639bb96 100644 --- a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts @@ -1,7 +1,7 @@ /// export declare const SignIn: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { - formFields: import("../../../types").FormFieldThemeProps[]; + formFields: Omit[]; error: string | undefined; } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; diff --git a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signInForm.d.ts b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signInForm.d.ts index 7dbc1321c..f57175ca5 100644 --- a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signInForm.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signInForm.d.ts @@ -1,7 +1,7 @@ /// export declare const SignInForm: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { - formFields: import("../../../types").FormFieldThemeProps[]; + formFields: Omit[]; error: string | undefined; } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; diff --git a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts index 380a6e333..32bc386b1 100644 --- a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts @@ -1,14 +1,13 @@ /// export declare const SignUp: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { - formFields: import("../../../types").FormFieldThemeProps[]; - error: string | undefined; - } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; clearError: () => void; onError: (error: string) => void; config: import("../../../types").NormalisedConfig; signInClicked?: (() => void) | undefined; onSuccess: (result: { user: import("supertokens-web-js/types").User }) => void; + formFields: import("../../../types").FormFieldThemeProps[]; + error: string | undefined; } >; diff --git a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUpForm.d.ts b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUpForm.d.ts index bbe4a2eb2..85b7e4c8d 100644 --- a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUpForm.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUpForm.d.ts @@ -1,15 +1,14 @@ /// export declare const SignUpForm: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { - formFields: import("../../../types").FormFieldThemeProps[]; - error: string | undefined; - } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; clearError: () => void; onError: (error: string) => void; config: import("../../../types").NormalisedConfig; signInClicked?: (() => void) | undefined; onSuccess: (result: { user: import("supertokens-web-js/types").User }) => void; + formFields: import("../../../types").FormFieldThemeProps[]; + error: string | undefined; } & { header?: JSX.Element | undefined; footer?: JSX.Element | undefined; diff --git a/lib/build/recipe/emailpassword/types.d.ts b/lib/build/recipe/emailpassword/types.d.ts index d819f58c8..d1cb6e9ea 100644 --- a/lib/build/recipe/emailpassword/types.d.ts +++ b/lib/build/recipe/emailpassword/types.d.ts @@ -26,7 +26,6 @@ import type { NormalisedConfig as NormalisedAuthRecipeModuleConfig, UserInput as AuthRecipeModuleUserInput, } from "../authRecipe/types"; -import type React from "react"; import type { Dispatch } from "react"; import type { OverrideableBuilder } from "supertokens-js-override"; import type { RecipeInterface } from "supertokens-web-js/recipe/emailpassword"; @@ -78,12 +77,16 @@ export declare type NormalisedSignInAndUpFeatureConfig = { signInForm: NormalisedSignInFormFeatureConfig; }; export declare type SignUpFormFeatureUserInput = FeatureBaseConfig & { - formFields?: FormFieldSignUpConfig[]; + formFields?: (FormField & { + inputComponent?: (props: InputProps) => JSX.Element; + })[]; privacyPolicyLink?: string; termsOfServiceLink?: string; }; export declare type NormalisedSignUpFormFeatureConfig = NormalisedBaseConfig & { - formFields: NormalisedFormField[]; + formFields: (NormalisedFormField & { + inputComponent?: (props: InputProps) => JSX.Element; + })[]; privacyPolicyLink?: string; termsOfServiceLink?: string; }; @@ -94,7 +97,6 @@ export declare type NormalisedSignInFormFeatureConfig = NormalisedBaseConfig & { formFields: NormalisedFormField[]; }; export declare type FormFieldSignInConfig = FormFieldBaseConfig; -export declare type FormFieldSignUpConfig = FormField; export declare type ResetPasswordUsingTokenUserInput = { disableDefaultUI?: boolean; submitNewPasswordForm?: FeatureBaseConfig; @@ -111,11 +113,11 @@ export declare type NormalisedSubmitNewPasswordForm = FeatureBaseConfig & { export declare type NormalisedEnterEmailForm = FeatureBaseConfig & { formFields: NormalisedFormField[]; }; -declare type FormThemeBaseProps = ThemeBaseProps & { - formFields: FormFieldThemeProps[]; +declare type NonSignUpFormThemeBaseProps = ThemeBaseProps & { + formFields: Omit[]; error: string | undefined; }; -export declare type SignInThemeProps = FormThemeBaseProps & { +export declare type SignInThemeProps = NonSignUpFormThemeBaseProps & { recipeImplementation: RecipeInterface; clearError: () => void; onError: (error: string) => void; @@ -124,13 +126,15 @@ export declare type SignInThemeProps = FormThemeBaseProps & { forgotPasswordClick: () => void; onSuccess: (result: { user: User }) => void; }; -export declare type SignUpThemeProps = FormThemeBaseProps & { +export declare type SignUpThemeProps = ThemeBaseProps & { recipeImplementation: RecipeInterface; clearError: () => void; onError: (error: string) => void; config: NormalisedConfig; signInClicked?: () => void; onSuccess: (result: { user: User }) => void; + formFields: FormFieldThemeProps[]; + error: string | undefined; }; export declare type SignInAndUpThemeProps = { signInForm: SignInThemeProps; @@ -144,9 +148,9 @@ export declare type SignInAndUpThemeProps = { }; export declare type FormFieldThemeProps = NormalisedFormField & { labelComponent?: JSX.Element; - inputComponent?: React.FC; showIsRequired?: boolean; clearOnSubmit?: boolean; + inputComponent?: (props: InputProps) => JSX.Element; }; export declare type FormFieldError = { id: string; @@ -192,7 +196,7 @@ export declare type ResetPasswordUsingTokenThemeProps = { config: NormalisedConfig; userContext?: any; }; -export declare type EnterEmailProps = FormThemeBaseProps & { +export declare type EnterEmailProps = NonSignUpFormThemeBaseProps & { recipeImplementation: RecipeInterface; error: string | undefined; clearError: () => void; @@ -200,7 +204,7 @@ export declare type EnterEmailProps = FormThemeBaseProps & { config: NormalisedConfig; onBackButtonClicked: () => void; }; -export declare type SubmitNewPasswordProps = FormThemeBaseProps & { +export declare type SubmitNewPasswordProps = NonSignUpFormThemeBaseProps & { recipeImplementation: RecipeInterface; error: string | undefined; clearError: () => void; diff --git a/lib/build/types.d.ts b/lib/build/types.d.ts index 1aa7f2568..ad8f5fb88 100644 --- a/lib/build/types.d.ts +++ b/lib/build/types.d.ts @@ -89,6 +89,8 @@ export declare type FormFieldBaseConfig = { id: string; label: string; placeholder?: string; + getDefaultValue?: () => string; + nonOptionalErrorMsg?: string; }; export declare type FormField = FormFieldBaseConfig & { validate?: (value: any) => Promise; @@ -104,8 +106,10 @@ export declare type NormalisedFormField = { placeholder: string; validate: (value: any) => Promise | string | undefined; optional: boolean; + nonOptionalErrorMsg?: string; autoComplete?: string; autofocus?: boolean; + getDefaultValue?: () => string; }; export declare type ReactComponentClass

= ComponentClass | ((props: P) => JSX.Element); export declare type FeatureBaseConfig = { diff --git a/lib/build/version.d.ts b/lib/build/version.d.ts index 51706b18d..61197a780 100644 --- a/lib/build/version.d.ts +++ b/lib/build/version.d.ts @@ -1 +1 @@ -export declare const package_version = "0.35.6"; +export declare const package_version = "0.35.7"; diff --git a/lib/ts/recipe/emailpassword/components/library/formBase.tsx b/lib/ts/recipe/emailpassword/components/library/formBase.tsx index 1dabbd92a..d532a325b 100644 --- a/lib/ts/recipe/emailpassword/components/library/formBase.tsx +++ b/lib/ts/recipe/emailpassword/components/library/formBase.tsx @@ -25,7 +25,7 @@ import STGeneralError from "supertokens-web-js/utils/error"; import { MANDATORY_FORM_FIELDS_ID_ARRAY } from "../../constants"; import type { APIFormField } from "../../../../types"; -import type { FormBaseProps } from "../../types"; +import type { FormBaseProps, FormFieldThemeProps } from "../../types"; import type { FormEvent } from "react"; import { Button, FormRow, Input, InputError, Label } from "."; @@ -37,6 +37,89 @@ type FieldState = { value: string; }; +const fetchDefaultValue = (field: FormFieldThemeProps): string => { + if (field.getDefaultValue !== undefined) { + const defaultValue = field.getDefaultValue(); + if (typeof defaultValue !== "string") { + throw new Error(`getDefaultValue for ${field.id} must return a string`); + } else { + return defaultValue; + } + } + return ""; +}; + +function InputComponentWrapper(props: { + field: FormFieldThemeProps; + type: string; + fstate: FieldState; + onInputFocus: (field: APIFormField) => void; + onInputBlur: (field: APIFormField) => void; + onInputChange: (field: APIFormField) => void; +}) { + const { field, type, fstate, onInputFocus, onInputBlur, onInputChange } = props; + + const useCallbackOnInputFocus = useCallback<(value: string) => void>( + (value) => { + onInputFocus({ + id: field.id, + value, + }); + }, + [onInputFocus, field] + ); + + const useCallbackOnInputBlur = useCallback<(value: string) => void>( + (value) => { + onInputBlur({ + id: field.id, + value, + }); + }, + [onInputBlur, field] + ); + + const useCallbackOnInputChange = useCallback( + (value) => { + onInputChange({ + id: field.id, + value, + }); + }, + [onInputChange, field] + ); + + return field.inputComponent !== undefined ? ( + + ) : ( + + ); +} + export const FormBase: React.FC> = (props) => { const { footer, buttonLabel, showLabels, validateOnBlur, formFields } = props; @@ -50,7 +133,7 @@ export const FormBase: React.FC> = (props) => { }, [unmounting]); const [fieldStates, setFieldStates] = useState( - props.formFields.map((f) => ({ id: f.id, value: "" })) + props.formFields.map((f) => ({ id: f.id, value: fetchDefaultValue(f) })) ); const [isLoading, setIsLoading] = useState(false); @@ -95,6 +178,9 @@ export const FormBase: React.FC> = (props) => { const onInputChange = useCallback( (field: APIFormField) => { + if (typeof field.value !== "string") { + throw new Error(`${field.id} value must be a string`); + } updateFieldState(field.id, (os) => ({ ...os, value: field.value, error: undefined })); props.clearError(); }, @@ -165,10 +251,18 @@ export const FormBase: React.FC> = (props) => { // If field error. if (result.status === "FIELD_ERROR") { const errorFields = result.formFields; - - setFieldStates((os) => - os.map((fs) => ({ ...fs, error: errorFields.find((ef: any) => ef.id === fs.id)?.error })) - ); + const getErrorMessage = (fs: FieldState) => { + const errorMessage = errorFields.find((ef: any) => ef.id === fs.id)?.error; + if (errorMessage === "Field is not optional") { + const fieldConfigData = props.formFields.find((f) => f.id === fs.id); + // replace non-optional server error message from nonOptionalErrorMsg + if (fieldConfigData?.nonOptionalErrorMsg !== undefined) { + return fieldConfigData?.nonOptionalErrorMsg; + } + } + return errorMessage; + }; + setFieldStates((os) => os.map((fs) => ({ ...fs, error: getErrorMessage(fs) }))); } } } catch (e) { @@ -191,12 +285,11 @@ export const FormBase: React.FC> = (props) => { if (field.id === "confirm-password") { type = "password"; } - const fstate: FieldState = fieldStates.find((s) => s.id === field.id) || { - id: field.id, - validated: false, - error: undefined, - value: "", - }; + + const fstate: FieldState | undefined = fieldStates.find((s) => s.id === field.id); + if (fstate === undefined) { + throw new Error("Should never come here"); + } return ( @@ -208,36 +301,14 @@ export const FormBase: React.FC> = (props) => { diff --git a/lib/ts/recipe/emailpassword/components/library/input.tsx b/lib/ts/recipe/emailpassword/components/library/input.tsx index 70f34f331..0f1877e1b 100644 --- a/lib/ts/recipe/emailpassword/components/library/input.tsx +++ b/lib/ts/recipe/emailpassword/components/library/input.tsx @@ -20,7 +20,6 @@ import CheckedIcon from "../../../../components/assets/checkedIcon"; import ErrorIcon from "../../../../components/assets/errorIcon"; import ShowPasswordIcon from "../../../../components/assets/showPasswordIcon"; -import type { APIFormField } from "../../../../types"; import type { ChangeEvent } from "react"; export type InputProps = { @@ -32,9 +31,9 @@ export type InputProps = { hasError: boolean; placeholder: string; value: string; - onInputBlur?: (field: APIFormField) => void; - onInputFocus?: (field: APIFormField) => void; - onChange?: (field: APIFormField) => void; + onInputBlur?: (value: string) => void; + onInputFocus?: (value: string) => void; + onChange?: (value: string) => void; }; const Input: React.FC = ({ @@ -59,28 +58,19 @@ const Input: React.FC = ({ function handleFocus() { if (onInputFocus !== undefined) { - onInputFocus({ - id: name, - value: value, - }); + onInputFocus(value); } } function handleBlur() { if (onInputBlur !== undefined) { - onInputBlur({ - id: name, - value, - }); + onInputBlur(value); } } function handleChange(event: ChangeEvent) { if (onChange) { - onChange({ - id: name, - value: event.target.value, - }); + onChange(event.target.value); } } diff --git a/lib/ts/recipe/emailpassword/components/library/label.tsx b/lib/ts/recipe/emailpassword/components/library/label.tsx index 5096b636a..428122455 100644 --- a/lib/ts/recipe/emailpassword/components/library/label.tsx +++ b/lib/ts/recipe/emailpassword/components/library/label.tsx @@ -26,7 +26,7 @@ export default function Label({ value, showIsRequired }: LabelProps): JSX.Elemen return (

{t(value)} - {showIsRequired && " *"} + {showIsRequired && value && value.trim() !== "" && " *"}
); } diff --git a/lib/ts/recipe/emailpassword/types.ts b/lib/ts/recipe/emailpassword/types.ts index 253329077..5ffe5b3d1 100644 --- a/lib/ts/recipe/emailpassword/types.ts +++ b/lib/ts/recipe/emailpassword/types.ts @@ -41,7 +41,6 @@ import type { NormalisedConfig as NormalisedAuthRecipeModuleConfig, UserInput as AuthRecipeModuleUserInput, } from "../authRecipe/types"; -import type React from "react"; import type { Dispatch } from "react"; import type { OverrideableBuilder } from "supertokens-js-override"; import type { RecipeInterface } from "supertokens-web-js/recipe/emailpassword"; @@ -135,7 +134,9 @@ export type SignUpFormFeatureUserInput = FeatureBaseConfig & { /* * Form fields for SignUp. */ - formFields?: FormFieldSignUpConfig[]; + formFields?: (FormField & { + inputComponent?: (props: InputProps) => JSX.Element; + })[]; /* * Privacy policy link for sign up form. @@ -152,7 +153,9 @@ export type NormalisedSignUpFormFeatureConfig = NormalisedBaseConfig & { /* * Normalised form fields for SignUp. */ - formFields: NormalisedFormField[]; + formFields: (NormalisedFormField & { + inputComponent?: (props: InputProps) => JSX.Element; + })[]; /* * Privacy policy link for sign up form. @@ -181,8 +184,6 @@ export type NormalisedSignInFormFeatureConfig = NormalisedBaseConfig & { export type FormFieldSignInConfig = FormFieldBaseConfig; -export type FormFieldSignUpConfig = FormField; - export type ResetPasswordUsingTokenUserInput = { /* * Disable default implementation with default routes. @@ -225,20 +226,16 @@ export type NormalisedEnterEmailForm = FeatureBaseConfig & { formFields: NormalisedFormField[]; }; -/* - * Props Types. - */ - -type FormThemeBaseProps = ThemeBaseProps & { +type NonSignUpFormThemeBaseProps = ThemeBaseProps & { /* - * Form fields to use in the signin form. + * Omit since, custom inputComponent only part of signup */ - formFields: FormFieldThemeProps[]; + formFields: Omit[]; error: string | undefined; }; -export type SignInThemeProps = FormThemeBaseProps & { +export type SignInThemeProps = NonSignUpFormThemeBaseProps & { recipeImplementation: RecipeInterface; clearError: () => void; onError: (error: string) => void; @@ -248,13 +245,15 @@ export type SignInThemeProps = FormThemeBaseProps & { onSuccess: (result: { user: User }) => void; }; -export type SignUpThemeProps = FormThemeBaseProps & { +export type SignUpThemeProps = ThemeBaseProps & { recipeImplementation: RecipeInterface; clearError: () => void; onError: (error: string) => void; config: NormalisedConfig; signInClicked?: () => void; onSuccess: (result: { user: User }) => void; + formFields: FormFieldThemeProps[]; + error: string | undefined; }; export type SignInAndUpThemeProps = { @@ -274,11 +273,6 @@ export type FormFieldThemeProps = NormalisedFormField & { */ labelComponent?: JSX.Element; - /* - * Custom component that replaces the standard input component - */ - inputComponent?: React.FC; - /* * Show Is required (*) next to label */ @@ -288,6 +282,11 @@ export type FormFieldThemeProps = NormalisedFormField & { * Clears the field after calling the API. */ clearOnSubmit?: boolean; + + /* + * Ability to add custom components + */ + inputComponent?: (props: InputProps) => JSX.Element; }; export type FormFieldError = { @@ -367,7 +366,7 @@ export type ResetPasswordUsingTokenThemeProps = { userContext?: any; }; -export type EnterEmailProps = FormThemeBaseProps & { +export type EnterEmailProps = NonSignUpFormThemeBaseProps & { recipeImplementation: RecipeInterface; error: string | undefined; clearError: () => void; @@ -376,7 +375,7 @@ export type EnterEmailProps = FormThemeBaseProps & { onBackButtonClicked: () => void; }; -export type SubmitNewPasswordProps = FormThemeBaseProps & { +export type SubmitNewPasswordProps = NonSignUpFormThemeBaseProps & { recipeImplementation: RecipeInterface; error: string | undefined; clearError: () => void; diff --git a/lib/ts/recipe/emailpassword/utils.ts b/lib/ts/recipe/emailpassword/utils.ts index 6220af0c5..c289b8653 100644 --- a/lib/ts/recipe/emailpassword/utils.ts +++ b/lib/ts/recipe/emailpassword/utils.ts @@ -338,11 +338,18 @@ export function mergeFormFields( } export function getFormattedFormField(field: NormalisedFormField): NormalisedFormField { + // Fields with the 'nonOptionalErrorMsg' property must have a valid message defined + if (field.optional === false && field.nonOptionalErrorMsg === "") { + throw new Error(`nonOptionalErrorMsg for field ${field.id} cannot be an empty string`); + } return { ...field, validate: async (value: any): Promise => { // Absent or not optional empty field if (value === "" && field.optional === false) { + if (field.nonOptionalErrorMsg !== undefined) { + return field.nonOptionalErrorMsg; + } return "ERROR_NON_OPTIONAL"; } diff --git a/lib/ts/recipe/passwordless/components/themes/signInUp/phoneNumberInput.tsx b/lib/ts/recipe/passwordless/components/themes/signInUp/phoneNumberInput.tsx index 584c230dd..2bff1c1d0 100644 --- a/lib/ts/recipe/passwordless/components/themes/signInUp/phoneNumberInput.tsx +++ b/lib/ts/recipe/passwordless/components/themes/signInUp/phoneNumberInput.tsx @@ -45,19 +45,13 @@ function PhoneNumberInput({ }: InputProps & PhoneNumberInputProps): JSX.Element { function handleFocus() { if (onInputFocus !== undefined) { - onInputFocus({ - id: name, - value: value, - }); + onInputFocus(value); } } function handleBlur() { if (onInputBlur !== undefined) { - onInputBlur({ - id: name, - value: value, - }); + onInputBlur(value); } } @@ -71,10 +65,7 @@ function PhoneNumberInput({ const handleChange = useCallback( (newValue: string) => { if (onChangeRef.current !== undefined) { - onChangeRef.current({ - id: name, - value: newValue, - }); + onChangeRef.current(newValue); } }, [onChangeRef] @@ -83,10 +74,7 @@ function PhoneNumberInput({ const handleCountryChange = useCallback( (ev) => { if (onChangeRef.current !== undefined && phoneInputInstance !== undefined) { - onChangeRef.current({ - id: name, - value: ev.target.value, - }); + onChangeRef.current(ev.target.value); } }, [onChangeRef] diff --git a/lib/ts/types.ts b/lib/ts/types.ts index 8399585b5..0f7771175 100644 --- a/lib/ts/types.ts +++ b/lib/ts/types.ts @@ -222,6 +222,16 @@ export type FormFieldBaseConfig = { * placeholder of the input field. */ placeholder?: string; + + /* + *Ability to provide default value to input field. + */ + getDefaultValue?: () => string; + + /* + * Error message for non optional field. + */ + nonOptionalErrorMsg?: string; }; export type FormField = FormFieldBaseConfig & { @@ -274,6 +284,11 @@ export type NormalisedFormField = { */ optional: boolean; + /* + * Error message for non optional field. + */ + nonOptionalErrorMsg?: string; + /* * Autocomplete input. */ @@ -283,6 +298,11 @@ export type NormalisedFormField = { * Moves focus to the input element when it mounts */ autofocus?: boolean; + + /* + *Ability to provide default value to input field. + */ + getDefaultValue?: () => string; }; export type ReactComponentClass

= ComponentClass | ((props: P) => JSX.Element); diff --git a/lib/ts/version.ts b/lib/ts/version.ts index ac4a22bc3..8d697de72 100644 --- a/lib/ts/version.ts +++ b/lib/ts/version.ts @@ -12,4 +12,4 @@ * License for the specific language governing permissions and limitations * under the License. */ -export const package_version = "0.35.6"; +export const package_version = "0.35.7"; diff --git a/package-lock.json b/package-lock.json index edc7549ce..f2efb65d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "supertokens-auth-react", - "version": "0.35.6", + "version": "0.35.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "supertokens-auth-react", - "version": "0.35.6", + "version": "0.35.7", "license": "Apache-2.0", "dependencies": { "intl-tel-input": "^17.0.19", @@ -2259,70 +2259,6 @@ "postcss-selector-parser": "^6.0.10" } }, - "node_modules/@esbuild/android-arm": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.14.tgz", - "integrity": "sha512-blODaaL+lngG5bdK/t4qZcQvq2BBqrABmYwqPPcS5VRxrCSGHb9R/rA3fqxh7R18I7WU4KKv+NYkt22FDfalcg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.14.tgz", - "integrity": "sha512-rZ2v+Luba5/3D6l8kofWgTnqE+qsC/L5MleKIKFyllHTKHrNBMqeRCnZI1BtRx8B24xMYxeU32iIddRQqMsOsg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.14.tgz", - "integrity": "sha512-qSwh8y38QKl+1Iqg+YhvCVYlSk3dVLk9N88VO71U4FUjtiSFylMWK3Ugr8GC6eTkkP4Tc83dVppt2n8vIdlSGg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.14.tgz", - "integrity": "sha512-9Hl2D2PBeDYZiNbnRKRWuxwHa9v5ssWBBjisXFkVcSP5cZqzZRFBUWEQuqBHO4+PKx4q4wgHoWtfQ1S7rUqJ2Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, "node_modules/@esbuild/darwin-x64": { "version": "0.18.14", "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.14.tgz", @@ -2339,278 +2275,6 @@ "node": ">=12" } }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.14.tgz", - "integrity": "sha512-h3OqR80Da4oQCIa37zl8tU5MwHQ7qgPV0oVScPfKJK21fSRZEhLE4IIVpmcOxfAVmqjU6NDxcxhYaM8aDIGRLw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.14.tgz", - "integrity": "sha512-ha4BX+S6CZG4BoH9tOZTrFIYC1DH13UTCRHzFc3GWX74nz3h/N6MPF3tuR3XlsNjMFUazGgm35MPW5tHkn2lzQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.14.tgz", - "integrity": "sha512-5+7vehI1iqru5WRtJyU2XvTOvTGURw3OZxe3YTdE9muNNIdmKAVmSHpB3Vw2LazJk2ifEdIMt/wTWnVe5V98Kg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.14.tgz", - "integrity": "sha512-IXORRe22In7U65NZCzjwAUc03nn8SDIzWCnfzJ6t/8AvGx5zBkcLfknI+0P+hhuftufJBmIXxdSTbzWc8X/V4w==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.14.tgz", - "integrity": "sha512-BfHlMa0nibwpjG+VXbOoqJDmFde4UK2gnW351SQ2Zd4t1N3zNdmUEqRkw/srC1Sa1DRBE88Dbwg4JgWCbNz/FQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.14.tgz", - "integrity": "sha512-j2/Ex++DRUWIAaUDprXd3JevzGtZ4/d7VKz+AYDoHZ3HjJzCyYBub9CU1wwIXN+viOP0b4VR3RhGClsvyt/xSw==", - "cpu": [ - "loong64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.14.tgz", - "integrity": "sha512-qn2+nc+ZCrJmiicoAnJXJJkZWt8Nwswgu1crY7N+PBR8ChBHh89XRxj38UU6Dkthl2yCVO9jWuafZ24muzDC/A==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.14.tgz", - "integrity": "sha512-aGzXzd+djqeEC5IRkDKt3kWzvXoXC6K6GyYKxd+wsFJ2VQYnOWE954qV2tvy5/aaNrmgPTb52cSCHFE+Z7Z0yg==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.14.tgz", - "integrity": "sha512-8C6vWbfr0ygbAiMFLS6OPz0BHvApkT2gCboOGV76YrYw+sD/MQJzyITNsjZWDXJwPu9tjrFQOVG7zijRzBCnLw==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.14.tgz", - "integrity": "sha512-G/Lf9iu8sRMM60OVGOh94ZW2nIStksEcITkXdkD09/T6QFD/o+g0+9WVyR/jajIb3A0LvBJ670tBnGe1GgXMgw==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.14.tgz", - "integrity": "sha512-TBgStYBQaa3EGhgqIDM+ECnkreb0wkcKqL7H6m+XPcGUoU4dO7dqewfbm0mWEQYH3kzFHrzjOFNpSAVzDZRSJw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.14.tgz", - "integrity": "sha512-stvCcjyCQR2lMTroqNhAbvROqRjxPEq0oQ380YdXxA81TaRJEucH/PzJ/qsEtsHgXlWFW6Ryr/X15vxQiyRXVg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.14.tgz", - "integrity": "sha512-apAOJF14CIsN5ht1PA57PboEMsNV70j3FUdxLmA2liZ20gEQnfTG5QU0FhENo5nwbTqCB2O3WDsXAihfODjHYw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.14.tgz", - "integrity": "sha512-fYRaaS8mDgZcGybPn2MQbn1ZNZx+UXFSUoS5Hd2oEnlsyUcr/l3c6RnXf1bLDRKKdLRSabTmyCy7VLQ7VhGdOQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.14.tgz", - "integrity": "sha512-1c44RcxKEJPrVj62XdmYhxXaU/V7auELCmnD+Ri+UCt+AGxTvzxl9uauQhrFso8gj6ZV1DaORV0sT9XSHOAk8Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.14.tgz", - "integrity": "sha512-EXAFttrdAxZkFQmpvcAQ2bywlWUsONp/9c2lcfvPUhu8vXBBenCXpoq9YkUvVP639ld3YGiYx0YUQ6/VQz3Maw==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.14.tgz", - "integrity": "sha512-K0QjGbcskx+gY+qp3v4/940qg8JitpXbdxFhRDA1aYoNaPff88+aEwoq45aqJ+ogpxQxmU0ZTjgnrQD/w8iiUg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -19242,34 +18906,6 @@ "dev": true, "requires": {} }, - "@esbuild/android-arm": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.14.tgz", - "integrity": "sha512-blODaaL+lngG5bdK/t4qZcQvq2BBqrABmYwqPPcS5VRxrCSGHb9R/rA3fqxh7R18I7WU4KKv+NYkt22FDfalcg==", - "dev": true, - "optional": true - }, - "@esbuild/android-arm64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.14.tgz", - "integrity": "sha512-rZ2v+Luba5/3D6l8kofWgTnqE+qsC/L5MleKIKFyllHTKHrNBMqeRCnZI1BtRx8B24xMYxeU32iIddRQqMsOsg==", - "dev": true, - "optional": true - }, - "@esbuild/android-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.14.tgz", - "integrity": "sha512-qSwh8y38QKl+1Iqg+YhvCVYlSk3dVLk9N88VO71U4FUjtiSFylMWK3Ugr8GC6eTkkP4Tc83dVppt2n8vIdlSGg==", - "dev": true, - "optional": true - }, - "@esbuild/darwin-arm64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.14.tgz", - "integrity": "sha512-9Hl2D2PBeDYZiNbnRKRWuxwHa9v5ssWBBjisXFkVcSP5cZqzZRFBUWEQuqBHO4+PKx4q4wgHoWtfQ1S7rUqJ2Q==", - "dev": true, - "optional": true - }, "@esbuild/darwin-x64": { "version": "0.18.14", "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.14.tgz", @@ -19277,125 +18913,6 @@ "dev": true, "optional": true }, - "@esbuild/freebsd-arm64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.14.tgz", - "integrity": "sha512-h3OqR80Da4oQCIa37zl8tU5MwHQ7qgPV0oVScPfKJK21fSRZEhLE4IIVpmcOxfAVmqjU6NDxcxhYaM8aDIGRLw==", - "dev": true, - "optional": true - }, - "@esbuild/freebsd-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.14.tgz", - "integrity": "sha512-ha4BX+S6CZG4BoH9tOZTrFIYC1DH13UTCRHzFc3GWX74nz3h/N6MPF3tuR3XlsNjMFUazGgm35MPW5tHkn2lzQ==", - "dev": true, - "optional": true - }, - "@esbuild/linux-arm": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.14.tgz", - "integrity": "sha512-5+7vehI1iqru5WRtJyU2XvTOvTGURw3OZxe3YTdE9muNNIdmKAVmSHpB3Vw2LazJk2ifEdIMt/wTWnVe5V98Kg==", - "dev": true, - "optional": true - }, - "@esbuild/linux-arm64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.14.tgz", - "integrity": "sha512-IXORRe22In7U65NZCzjwAUc03nn8SDIzWCnfzJ6t/8AvGx5zBkcLfknI+0P+hhuftufJBmIXxdSTbzWc8X/V4w==", - "dev": true, - "optional": true - }, - "@esbuild/linux-ia32": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.14.tgz", - "integrity": "sha512-BfHlMa0nibwpjG+VXbOoqJDmFde4UK2gnW351SQ2Zd4t1N3zNdmUEqRkw/srC1Sa1DRBE88Dbwg4JgWCbNz/FQ==", - "dev": true, - "optional": true - }, - "@esbuild/linux-loong64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.14.tgz", - "integrity": "sha512-j2/Ex++DRUWIAaUDprXd3JevzGtZ4/d7VKz+AYDoHZ3HjJzCyYBub9CU1wwIXN+viOP0b4VR3RhGClsvyt/xSw==", - "dev": true, - "optional": true - }, - "@esbuild/linux-mips64el": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.14.tgz", - "integrity": "sha512-qn2+nc+ZCrJmiicoAnJXJJkZWt8Nwswgu1crY7N+PBR8ChBHh89XRxj38UU6Dkthl2yCVO9jWuafZ24muzDC/A==", - "dev": true, - "optional": true - }, - "@esbuild/linux-ppc64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.14.tgz", - "integrity": "sha512-aGzXzd+djqeEC5IRkDKt3kWzvXoXC6K6GyYKxd+wsFJ2VQYnOWE954qV2tvy5/aaNrmgPTb52cSCHFE+Z7Z0yg==", - "dev": true, - "optional": true - }, - "@esbuild/linux-riscv64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.14.tgz", - "integrity": "sha512-8C6vWbfr0ygbAiMFLS6OPz0BHvApkT2gCboOGV76YrYw+sD/MQJzyITNsjZWDXJwPu9tjrFQOVG7zijRzBCnLw==", - "dev": true, - "optional": true - }, - "@esbuild/linux-s390x": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.14.tgz", - "integrity": "sha512-G/Lf9iu8sRMM60OVGOh94ZW2nIStksEcITkXdkD09/T6QFD/o+g0+9WVyR/jajIb3A0LvBJ670tBnGe1GgXMgw==", - "dev": true, - "optional": true - }, - "@esbuild/linux-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.14.tgz", - "integrity": "sha512-TBgStYBQaa3EGhgqIDM+ECnkreb0wkcKqL7H6m+XPcGUoU4dO7dqewfbm0mWEQYH3kzFHrzjOFNpSAVzDZRSJw==", - "dev": true, - "optional": true - }, - "@esbuild/netbsd-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.14.tgz", - "integrity": "sha512-stvCcjyCQR2lMTroqNhAbvROqRjxPEq0oQ380YdXxA81TaRJEucH/PzJ/qsEtsHgXlWFW6Ryr/X15vxQiyRXVg==", - "dev": true, - "optional": true - }, - "@esbuild/openbsd-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.14.tgz", - "integrity": "sha512-apAOJF14CIsN5ht1PA57PboEMsNV70j3FUdxLmA2liZ20gEQnfTG5QU0FhENo5nwbTqCB2O3WDsXAihfODjHYw==", - "dev": true, - "optional": true - }, - "@esbuild/sunos-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.14.tgz", - "integrity": "sha512-fYRaaS8mDgZcGybPn2MQbn1ZNZx+UXFSUoS5Hd2oEnlsyUcr/l3c6RnXf1bLDRKKdLRSabTmyCy7VLQ7VhGdOQ==", - "dev": true, - "optional": true - }, - "@esbuild/win32-arm64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.14.tgz", - "integrity": "sha512-1c44RcxKEJPrVj62XdmYhxXaU/V7auELCmnD+Ri+UCt+AGxTvzxl9uauQhrFso8gj6ZV1DaORV0sT9XSHOAk8Q==", - "dev": true, - "optional": true - }, - "@esbuild/win32-ia32": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.14.tgz", - "integrity": "sha512-EXAFttrdAxZkFQmpvcAQ2bywlWUsONp/9c2lcfvPUhu8vXBBenCXpoq9YkUvVP639ld3YGiYx0YUQ6/VQz3Maw==", - "dev": true, - "optional": true - }, - "@esbuild/win32-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.14.tgz", - "integrity": "sha512-K0QjGbcskx+gY+qp3v4/940qg8JitpXbdxFhRDA1aYoNaPff88+aEwoq45aqJ+ogpxQxmU0ZTjgnrQD/w8iiUg==", - "dev": true, - "optional": true - }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", diff --git a/package.json b/package.json index 98d858cee..eedec85f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "supertokens-auth-react", - "version": "0.35.6", + "version": "0.35.7", "description": "ReactJS SDK that provides login functionality with SuperTokens.", "main": "./index.js", "engines": { diff --git a/test/end-to-end/signin.test.js b/test/end-to-end/signin.test.js index 86a204645..bcbb7cff1 100644 --- a/test/end-to-end/signin.test.js +++ b/test/end-to-end/signin.test.js @@ -53,6 +53,8 @@ import { getInvalidClaimsJSON as getInvalidClaims, waitForText, backendBeforeEach, + getInputField, + isReact16, } from "../helpers"; import fetch from "isomorphic-fetch"; import { SOMETHING_WENT_WRONG_ERROR } from "../constants"; @@ -669,6 +671,136 @@ describe("SuperTokens SignIn", function () { }); }); }); + + describe("Default fields", function () { + before(function () { + const isReact16App = isReact16(); + if (isReact16App) { + this.skip(); + } + }); + + it("Should contain email and password fields prefilled", async function () { + await page.evaluate(() => window.localStorage.setItem("SIGNIN_SETTING_TYPE", "DEFAULT_FIELDS")); + + await page.reload({ + waitUntil: "domcontentloaded", + }); + + const expectedDefaultValues = { + email: "abc@xyz.com", + password: "fakepassword123", + }; + + const emailInput = await getInputField(page, "email"); + const defaultEmail = await emailInput.evaluate((f) => f.value); + assert.strictEqual(defaultEmail, expectedDefaultValues["email"]); + + const passwordInput = await getInputField(page, "password"); + const defaultPassword = await passwordInput.evaluate((f) => f.value); + assert.strictEqual(defaultPassword, expectedDefaultValues["password"]); + }); + + it("Should have default values in the signin request payload", async function () { + await page.evaluate(() => window.localStorage.setItem("SIGNIN_SETTING_TYPE", "DEFAULT_FIELDS")); + + await page.reload({ + waitUntil: "domcontentloaded", + }); + + const expectedDefautlValues = [ + { id: "email", value: "abc@xyz.com" }, + { id: "password", value: "fakepassword123" }, + ]; + + let assertionError = null; + let interceptionPassed = false; + + const requestHandler = async (request) => { + if (request.url().includes(SIGN_IN_API) && request.method() === "POST") { + try { + const postData = JSON.parse(request.postData()); + expectedDefautlValues.forEach(({ id, value }) => { + let findFormData = postData.formFields.find((inputData) => inputData.id === id); + assert.ok(findFormData, "Field not found in req.data"); + assert.strictEqual(findFormData["value"], value, `Mismatch in payload for key: ${id}`); + }); + interceptionPassed = true; + return request.respond({ + status: 200, + headers: { + "access-control-allow-origin": TEST_CLIENT_BASE_URL, + "access-control-allow-credentials": "true", + }, + body: JSON.stringify({ + status: "OK", + }), + }); + } catch (error) { + assertionError = error; // Store the error + } + } + return request.continue(); + }; + + await page.setRequestInterception(true); + page.on("request", requestHandler); + + try { + // Perform the button click and wait for all network activity to finish + await Promise.all([page.waitForNetworkIdle(), submitForm(page)]); + } finally { + page.off("request", requestHandler); + await page.setRequestInterception(false); + } + assert.ok(!assertionError, assertionError?.message); + assert.ok(interceptionPassed, "Test Failed"); + }); + }); + + describe("nonOptionalErrorMsg", function () { + before(function () { + const isReact16App = isReact16(); + if (isReact16App) { + this.skip(); + } + }); + + it("Should be displayed on a blank form submit", async function () { + // set cookie and reload which loads the form with custom field + await page.evaluate(() => + window.localStorage.setItem("SIGNIN_SETTING_TYPE", "FIELDS_WITH_NON_OPTIONAL_ERROR_MESSAGE") + ); + await page.reload({ + waitUntil: "domcontentloaded", + }); + + let apiCallMade = false; + + const requestHandler = (request) => { + const url = request.url(); + if (url === SIGN_IN_API) { + apiCallMade = true; + request.continue(); + } else { + request.continue(); + } + }; + page.on("request", requestHandler); + + try { + await submitForm(page); + let formFieldErrors = await getFieldErrors(page); + + // Also standard non-optional-error is displayed if nonOptionalErrorMsg is not provided + assert.deepStrictEqual(formFieldErrors, ["Please add email", "Field is not optional"]); + } finally { + page.off("request", requestHandler); + } + + assert.ok(!apiCallMade, "Empty form making API request to signin"); + }); + }); }); describe("SuperTokens SignIn => Server Error", function () { diff --git a/test/end-to-end/signup.test.js b/test/end-to-end/signup.test.js index 857bfbc42..c747339ca 100644 --- a/test/end-to-end/signup.test.js +++ b/test/end-to-end/signup.test.js @@ -39,6 +39,9 @@ import { getGeneralError, waitForSTElement, backendBeforeEach, + setSelectDropdownValue, + getInputField, + isReact16, } from "../helpers"; import { @@ -342,6 +345,438 @@ describe("SuperTokens SignUp", function () { assert.deepStrictEqual(emailError, "This email already exists. Please sign in instead."); }); }); + + describe("Custom fields tests", function () { + before(function () { + const isReact16App = isReact16(); + if (isReact16App) { + this.skip(); + } + }); + beforeEach(async function () { + // set cookie and reload which loads the form with custom field + await page.evaluate(() => window.localStorage.setItem("SIGNUP_SETTING_TYPE", "CUSTOM_FIELDS")); + + await page.reload({ + waitUntil: "domcontentloaded", + }); + await toggleSignInSignUp(page); + }); + + it("Should load the custom fields", async function () { + let text = await getAuthPageHeaderText(page); + assert.deepStrictEqual(text, "Sign Up"); + + // check if select dropdown is loaded + const selectDropdownExists = await waitForSTElement(page, "select"); + assert.ok(selectDropdownExists, "Select dropdown exists"); + + // check if checbox is loaded + const checkboxExists = await waitForSTElement(page, 'input[type="checkbox"]'); + assert.ok(checkboxExists, "Checkbox exists"); + + // check if labels are loaded correctly + // non-optional field with empty labels should'nt show * sign + const expectedLabels = ["Email *", "Password *", "Select Dropdown", ""]; + const labelNames = await getLabelsText(page); + assert.deepStrictEqual(labelNames, expectedLabels); + }); + + it("Should show error messages, based on optional flag", async function () { + await submitForm(page); + let formFieldErrors = await getFieldErrors(page); + + // 2 regular form field errors + + // 1 required custom field => terms checkbox + assert.deepStrictEqual(formFieldErrors, [ + "Field is not optional", + "Field is not optional", + "You must accept the terms and conditions", + ]); + + // supply values for regular-required fields only + await setInputValues(page, [ + { name: "email", value: "jack.doe@supertokens.io" }, + { name: "password", value: "Str0ngP@ssw0rd" }, + ]); + + await submitForm(page); + formFieldErrors = await getFieldErrors(page); + assert.deepStrictEqual(formFieldErrors, ["You must accept the terms and conditions"]); + + // check terms and condition checkbox + let termsCheckbox = await waitForSTElement(page, '[name="terms"]'); + await page.evaluate((e) => e.click(), termsCheckbox); + + //un-checking the required checkbox should throw custom error message + await page.evaluate((e) => e.click(), termsCheckbox); + + await submitForm(page); + formFieldErrors = await getFieldErrors(page); + assert.deepStrictEqual(formFieldErrors, ["Please check Terms and conditions"]); + }); + + it("Should be part of the signup payload", async function () { + const customFields = { + terms: "true", + "select-dropdown": "option 3", + }; + let assertionError = null; + let interceptionPassed = false; + + const requestHandler = async (request) => { + if (request.url().includes(SIGN_UP_API) && request.method() === "POST") { + try { + const postData = JSON.parse(request.postData()); + Object.keys(customFields).forEach((key) => { + let findFormData = postData.formFields.find((inputData) => inputData.id === key); + assert.ok(findFormData, "Field not found in req.data"); + assert.strictEqual( + findFormData["value"], + customFields[key], + `Mismatch in payload for key: ${key}` + ); + }); + interceptionPassed = true; + return request.respond({ + status: 200, + headers: { + "access-control-allow-origin": TEST_CLIENT_BASE_URL, + "access-control-allow-credentials": "true", + }, + body: JSON.stringify({ + status: "OK", + }), + }); + } catch (error) { + assertionError = error; // Store the error + } + } + return request.continue(); + }; + + await page.setRequestInterception(true); + page.on("request", requestHandler); + + try { + // Fill and submit the form with custom fields + await setInputValues(page, [ + { name: "email", value: "john.doe@supertokens.io" }, + { name: "password", value: "Str0ngP@assw0rd" }, + ]); + + await setSelectDropdownValue(page, "select", customFields["select-dropdown"]); + + // Check terms and condition checkbox + let termsCheckbox = await waitForSTElement(page, '[name="terms"]'); + await page.evaluate((e) => e.click(), termsCheckbox); + + // Perform the button click and wait for all network activity to finish + await Promise.all([page.waitForNetworkIdle(), submitForm(page)]); + } finally { + page.off("request", requestHandler); + await page.setRequestInterception(false); + } + + assert.ok(!assertionError, assertionError?.message); + assert.ok(interceptionPassed, "Test Failed"); + }); + + it("Should display nonOptionalErrorMsg on blank form submit", async function () { + let apiCallMade = false; + + const requestHandler = (request) => { + const url = request.url(); + if (url === SIGN_UP_API) { + apiCallMade = true; + request.continue(); + } else { + request.continue(); + } + }; + + page.on("request", requestHandler); + + try { + // Fill and submit the form with custom fields + await submitForm(page); + let formFieldErrors = await getFieldErrors(page); + // Also standard non-optional-error is displayed if nonOptionalErrorMsg is not provided + assert.deepStrictEqual(formFieldErrors, [ + "Field is not optional", + "Field is not optional", + "You must accept the terms and conditions", + ]); + } finally { + page.off("request", requestHandler); + } + + assert.ok(!apiCallMade, "Empty form making signup API request"); + }); + + it("Should overwrite server error message for non-optional fields with nonOptionalErrorMsg", async function () { + const requestHandler = (request) => { + if (request.method() === "POST" && request.url() === SIGN_UP_API) { + request.respond({ + status: 200, + contentType: "application/json", + headers: { + "access-control-allow-origin": TEST_CLIENT_BASE_URL, + "access-control-allow-credentials": "true", + }, + body: JSON.stringify({ + status: "FIELD_ERROR", + formFields: [ + { + id: "select-dropdown", + error: "Field is not optional", + }, + { + id: "email", + error: "Field is not optional", + }, + ], + }), + }); + } else { + request.continue(); + } + }; + + try { + await page.setRequestInterception(true); + page.on("request", requestHandler); + + // Fill and submit the form with custom fields + await setInputValues(page, [ + { name: "email", value: "john.doe@supertokens.io" }, + { name: "password", value: "Str0ngP@assw0rd" }, + ]); + // Check terms and condition checkbox + let termsCheckbox = await waitForSTElement(page, '[name="terms"]'); + await page.evaluate((e) => e.click(), termsCheckbox); + + // Perform the button click and wait for all network activity to finish + await Promise.all([page.waitForNetworkIdle(), submitForm(page)]); + + await waitForSTElement(page, "[data-supertokens~='inputErrorMessage']"); + // should also show the server error message if nonOptionalErrorMsg is not provided + let formFieldsErrors = await getFieldErrors(page); + assert.deepStrictEqual(formFieldsErrors, [ + "Field is not optional", + "Select dropdown is not an optional", + ]); + } finally { + page.off("request", requestHandler); + await page.setRequestInterception(false); + } + }); + }); + + // Default values test + describe("Default fields tests", function () { + before(function () { + const isReact16App = isReact16(); + if (isReact16App) { + this.skip(); + } + }); + + beforeEach(async function () { + // set cookie and reload which loads the form fields with default values + await page.evaluate(() => + window.localStorage.setItem("SIGNUP_SETTING_TYPE", "CUSTOM_FIELDS_WITH_DEFAULT_VALUES") + ); + + await page.reload({ + waitUntil: "domcontentloaded", + }); + await toggleSignInSignUp(page); + }); + + it("Should prefill the fields with default values", async function () { + const fieldsWithDefault = { + country: "India", + "select-dropdown": "option 2", + terms: true, + }; + + // regular input field default value + const countryInput = await getInputField(page, "country"); + const defaultCountry = await countryInput.evaluate((f) => f.value); + assert.strictEqual(defaultCountry, fieldsWithDefault["country"]); + + // custom dropdown default value is also getting set correctly + const selectDropdown = await waitForSTElement(page, "select"); + const defaultOption = await selectDropdown.evaluate((f) => f.value); + assert.strictEqual(defaultOption, fieldsWithDefault["select-dropdown"]); + + // custom dropdown default value is also getting set correctly + const termsCheckbox = await waitForSTElement(page, '[name="terms"]'); + // checkbox is checked + const defaultChecked = await termsCheckbox.evaluate((f) => f.checked); + assert.strictEqual(defaultChecked, fieldsWithDefault["terms"]); + // also the value = string + const defaultValue = await termsCheckbox.evaluate((f) => f.value); + assert.strictEqual(defaultValue, fieldsWithDefault["terms"].toString()); + }); + + it("Should be able to overwrite the default values", async function () { + const updatedFields = { + country: "USA", + "select-dropdown": "option 3", + }; + + await setInputValues(page, [{ name: "country", value: updatedFields["country"] }]); + await setSelectDropdownValue(page, "select", updatedFields["select-dropdown"]); + + // input field default value + const countryInput = await getInputField(page, "country"); + const updatedCountry = await countryInput.evaluate((f) => f.value); + assert.strictEqual(updatedCountry, updatedFields["country"]); + + // dropdown default value is also getting set correctly + const selectDropdown = await waitForSTElement(page, "select"); + const updatedOption = await selectDropdown.evaluate((f) => f.value); + assert.strictEqual(updatedOption, updatedFields["select-dropdown"]); + }); + + it("Should ensure signup-payload contains default values", async function () { + // directly submit the form and test the payload + const expectedDefautlValues = [ + { id: "email", value: "test@one.com" }, + { id: "password", value: "fakepassword123" }, + { id: "terms", value: "true" }, + { id: "select-dropdown", value: "option 2" }, + { id: "country", value: "India" }, + ]; + + let assertionError = null; + let interceptionPassed = false; + + const requestHandler = async (request) => { + if (request.url().includes(SIGN_UP_API) && request.method() === "POST") { + try { + const postData = JSON.parse(request.postData()); + expectedDefautlValues.forEach(({ id, value }) => { + let findFormData = postData.formFields.find((inputData) => inputData.id === id); + assert.ok(findFormData, "Field not found in req.data"); + assert.strictEqual(findFormData["value"], value, `Mismatch in payload for key: ${id}`); + }); + interceptionPassed = true; + return request.respond({ + status: 200, + headers: { + "access-control-allow-origin": TEST_CLIENT_BASE_URL, + "access-control-allow-credentials": "true", + }, + body: JSON.stringify({ + status: "OK", + }), + }); + } catch (error) { + assertionError = error; // Store the error + } + } + return request.continue(); + }; + + await page.setRequestInterception(true); + page.on("request", requestHandler); + + try { + // Perform the button click and wait for all network activity to finish + await Promise.all([page.waitForNetworkIdle(), submitForm(page)]); + } finally { + page.off("request", requestHandler); + await page.setRequestInterception(false); + } + + assert.ok(!assertionError, assertionError?.message); + assert.ok(interceptionPassed, "Test Failed"); + }); + }); + + describe("Incorrect field config test", function () { + before(function () { + const isReact16App = isReact16(); + if (isReact16App) { + this.skip(); + } + }); + + beforeEach(async function () { + // set cookie and reload which loads the form fields with default values + await page.evaluate(() => window.localStorage.setItem("SIGNUP_SETTING_TYPE", "INCORRECT_FIELDS")); + + await page.reload({ + waitUntil: "domcontentloaded", + }); + }); + + it("Should throw error for incorrect getDefaultValue func call", async function () { + await page.evaluate(() => window.localStorage.setItem("SIGNUP_SETTING_TYPE", "INCORRECT_GETDEFAULT")); + let pageErrorMessage = ""; + page.on("pageerror", (err) => { + pageErrorMessage = err.message; + }); + + await page.reload({ + waitUntil: "domcontentloaded", + }); + await toggleSignInSignUp(page); + + const expectedErrorMessage = "getDefaultValue for country must return a string"; + assert( + pageErrorMessage.includes(expectedErrorMessage), + `Expected "${expectedErrorMessage}" to be included in page-error` + ); + }); + + it("Should throw error for non-string params to onChange", async function () { + await page.evaluate(() => window.localStorage.setItem("SIGNUP_SETTING_TYPE", "INCORRECT_ONCHANGE")); + await page.reload({ + waitUntil: "domcontentloaded", + }); + await toggleSignInSignUp(page); + + let pageErrorMessage = ""; + page.on("pageerror", (err) => { + pageErrorMessage = err.message; + }); + + // check terms and condition checkbox since it emits non-string value => boolean + let termsCheckbox = await waitForSTElement(page, '[name="terms"]'); + await page.evaluate((e) => e.click(), termsCheckbox); + + const expectedErrorMessage = "terms value must be a string"; + assert( + pageErrorMessage.includes(expectedErrorMessage), + `Expected "${expectedErrorMessage}" to be included in page-error` + ); + }); + + it("Should throw error for empty string for nonOptionalErrorMsg", async function () { + const expectedErrorMessage = "nonOptionalErrorMsg for field city cannot be an empty string"; + let pageErrorMessage = ""; + page.on("pageerror", (err) => { + pageErrorMessage = err.message; + }); + + await page.evaluate(() => + window.localStorage.setItem("SIGNUP_SETTING_TYPE", "INCORRECT_NON_OPTIONAL_ERROR_MSG") + ); + await page.reload({ + waitUntil: "domcontentloaded", + }); + + assert.ok(pageErrorMessage !== "", "Empty nonOptionalErrorMsg should throw error"); + assert( + pageErrorMessage.includes(expectedErrorMessage), + `Expected "${expectedErrorMessage}" to be included in page-error` + ); + }); + }); }); describe("SuperTokens SignUp => Server Error", function () { diff --git a/test/end-to-end/thirdpartyemailpassword.test.js b/test/end-to-end/thirdpartyemailpassword.test.js index ed257a2b6..d7a29ddea 100644 --- a/test/end-to-end/thirdpartyemailpassword.test.js +++ b/test/end-to-end/thirdpartyemailpassword.test.js @@ -44,6 +44,10 @@ import { getFeatureFlags, setEnabledRecipes, backendBeforeEach, + setSelectDropdownValue, + getInputField, + getLabelsText, + isReact16, } from "../helpers"; import { TEST_CLIENT_BASE_URL, @@ -440,4 +444,531 @@ describe("SuperTokens Third Party Email Password", function () { assert.strictEqual(getAuthFromBackendInStorage, "true"); }); }); + + describe("SignIn default field tests", function () { + before(function () { + const isReact16App = isReact16(); + if (isReact16App) { + this.skip(); + } + }); + + it("Should contain email and password fields prefilled", async function () { + await page.evaluate(() => window.localStorage.setItem("SIGNIN_SETTING_TYPE", "DEFAULT_FIELDS")); + + await page.reload({ + waitUntil: "domcontentloaded", + }); + + const expectedDefaultValues = { + email: "abc@xyz.com", + password: "fakepassword123", + }; + + const emailInput = await getInputField(page, "email"); + const defaultEmail = await emailInput.evaluate((f) => f.value); + assert.strictEqual(defaultEmail, expectedDefaultValues["email"]); + + const passwordInput = await getInputField(page, "password"); + const defaultPassword = await passwordInput.evaluate((f) => f.value); + assert.strictEqual(defaultPassword, expectedDefaultValues["password"]); + }); + + it("Check on blank form submit nonOptionalErrorMsg gets displayed as expected", async function () { + // set cookie and reload which loads the form with custom field + await page.evaluate(() => + window.localStorage.setItem("SIGNIN_SETTING_TYPE", "FIELDS_WITH_NON_OPTIONAL_ERROR_MESSAGE") + ); + await page.reload({ + waitUntil: "domcontentloaded", + }); + + await waitForSTElement(page); + let apiCallMade = false; + + await page.setRequestInterception(true); + + const requestHandler = (request) => { + const url = request.url(); + if (url === SIGN_IN_API) { + apiCallMade = true; + request.continue(); + } else { + request.continue(); + } + }; + + page.on("request", requestHandler); + + try { + await submitForm(page); + let formFieldErrors = await getFieldErrors(page); + + // Also standard non-optional-error is displayed if nonOptionalErrorMsg is not provided + assert.deepStrictEqual(formFieldErrors, ["Please add email", "Field is not optional"]); + } finally { + page.off("request", requestHandler); + await page.setRequestInterception(false); + } + + if (apiCallMade) { + throw new Error("Empty form making API request to signin"); + } + }); + }); + + describe("Third Party signup config supports custom fields tests", function () { + before(function () { + const isReact16App = isReact16(); + if (isReact16App) { + this.skip(); + } + }); + + beforeEach(async function () { + await page.evaluate(() => window.localStorage.setItem("SIGNUP_SETTING_TYPE", "CUSTOM_FIELDS")); + + await page.reload({ + waitUntil: "domcontentloaded", + }); + await toggleSignInSignUp(page); + }); + + it("Check if the custom fields are loaded", async function () { + let text = await getAuthPageHeaderText(page); + assert.deepStrictEqual(text, "Sign Up"); + + // check if select dropdown is loaded + const selectDropdownExists = await waitForSTElement(page, "select"); + assert.ok(selectDropdownExists, "Select dropdown exists"); + + // check if checbox is loaded + const checkboxExists = await waitForSTElement(page, 'input[type="checkbox"]'); + assert.ok(checkboxExists, "Checkbox exists"); + + // check if labels are loaded correctly + // non-optional field with empty labels should'nt show * sign + const expectedLabels = ["Email *", "Password *", "Select Dropdown", ""]; + const labelNames = await getLabelsText(page); + assert.deepStrictEqual(labelNames, expectedLabels); + }); + + it("Should show error messages, based on optional flag", async function () { + await submitForm(page); + let formFieldErrors = await getFieldErrors(page); + + // 2 regular form field errors + + // 1 required custom field => terms checkbox + assert.deepStrictEqual(formFieldErrors, [ + "Field is not optional", + "Field is not optional", + "You must accept the terms and conditions", + ]); + + // supply values for regular-required fields only + await setInputValues(page, [ + { name: "email", value: "jack.doe@supertokens.io" }, + { name: "password", value: "Str0ngP@ssw0rd" }, + ]); + + await submitForm(page); + formFieldErrors = await getFieldErrors(page); + assert.deepStrictEqual(formFieldErrors, ["You must accept the terms and conditions"]); + + // check terms and condition checkbox + let termsCheckbox = await waitForSTElement(page, '[name="terms"]'); + await page.evaluate((e) => e.click(), termsCheckbox); + + //un-checking the required checkbox should throw custom error message + await page.evaluate((e) => e.click(), termsCheckbox); + + await submitForm(page); + formFieldErrors = await getFieldErrors(page); + assert.deepStrictEqual(formFieldErrors, ["Please check Terms and conditions"]); + }); + + it("Check if custom values are part of the signup payload", async function () { + const customFields = { + terms: "true", + "select-dropdown": "option 3", + }; + let assertionError = null; + let interceptionPassed = false; + + const requestHandler = async (request) => { + if (request.url().includes(SIGN_UP_API) && request.method() === "POST") { + try { + const postData = JSON.parse(request.postData()); + Object.keys(customFields).forEach((key) => { + let findFormData = postData.formFields.find((inputData) => inputData.id === key); + if (findFormData) { + assert.strictEqual( + findFormData["value"], + customFields[key], + `Mismatch in payload for key: ${key}` + ); + } else { + throw new Error("Field not found in req.data"); + } + }); + interceptionPassed = true; + return request.respond({ + status: 200, + headers: { + "access-control-allow-origin": TEST_CLIENT_BASE_URL, + "access-control-allow-credentials": "true", + }, + body: JSON.stringify({ + status: "OK", + }), + }); + } catch (error) { + assertionError = error; // Store the error + } + } + return request.continue(); + }; + + await page.setRequestInterception(true); + page.on("request", requestHandler); + + try { + // Fill and submit the form with custom fields + await setInputValues(page, [ + { name: "email", value: "john.doe@supertokens.io" }, + { name: "password", value: "Str0ngP@assw0rd" }, + ]); + + await setSelectDropdownValue(page, "select", customFields["select-dropdown"]); + + // Check terms and condition checkbox + let termsCheckbox = await waitForSTElement(page, '[name="terms"]'); + await page.evaluate((e) => e.click(), termsCheckbox); + + // Perform the button click and wait for all network activity to finish + await Promise.all([page.waitForNetworkIdle(), submitForm(page)]); + } finally { + page.off("request", requestHandler); + await page.setRequestInterception(false); + } + + if (assertionError) { + throw assertionError; + } + + if (!interceptionPassed) { + throw new Error("test failed"); + } + }); + + it("Check on blank form submit nonOptionalErrorMsg gets displayed as expected", async function () { + let apiCallMade = false; + + const requestHandler = (request) => { + const url = request.url(); + if (url === SIGN_UP_API) { + apiCallMade = true; + request.continue(); + } else { + request.continue(); + } + }; + + await page.setRequestInterception(true); + page.on("request", requestHandler); + + try { + // Fill and submit the form with custom fields + await submitForm(page); + let formFieldErrors = await getFieldErrors(page); + // Also standard non-optional-error is displayed if nonOptionalErrorMsg is not provided + assert.deepStrictEqual(formFieldErrors, [ + "Field is not optional", + "Field is not optional", + "You must accept the terms and conditions", + ]); + } finally { + page.off("request", requestHandler); + await page.setRequestInterception(false); + } + + if (apiCallMade) { + throw new Error("Empty form making API request to sign-up"); + } + }); + + it("Check if nonOptionalErrorMsg overwrites server error message for non-optional fields", async function () { + const requestHandler = (request) => { + if (request.method() === "POST" && request.url() === SIGN_UP_API) { + request.respond({ + status: 200, + contentType: "application/json", + headers: { + "access-control-allow-origin": TEST_CLIENT_BASE_URL, + "access-control-allow-credentials": "true", + }, + body: JSON.stringify({ + status: "FIELD_ERROR", + formFields: [ + { + id: "select-dropdown", + error: "Field is not optional", + }, + { + id: "email", + error: "Field is not optional", + }, + ], + }), + }); + } else { + request.continue(); + } + }; + + try { + await page.setRequestInterception(true); + page.on("request", requestHandler); + + // Fill and submit the form with custom fields + await setInputValues(page, [ + { name: "email", value: "john.doe@supertokens.io" }, + { name: "password", value: "Str0ngP@assw0rd" }, + ]); + // Check terms and condition checkbox + let termsCheckbox = await waitForSTElement(page, '[name="terms"]'); + await page.evaluate((e) => e.click(), termsCheckbox); + + // Perform the button click and wait for all network activity to finish + await Promise.all([page.waitForNetworkIdle(), submitForm(page)]); + + await waitForSTElement(page, "[data-supertokens~='inputErrorMessage']"); + // should also show the server error message if nonOptionalErrorMsg is not provided + let formFieldsErrors = await getFieldErrors(page); + assert.deepStrictEqual(formFieldsErrors, [ + "Field is not optional", + "Select dropdown is not an optional", + ]); + } finally { + page.off("request", requestHandler); + await page.setRequestInterception(false); + } + }); + }); + + // Default values test + describe("Third Party signup default value for fields test", function () { + before(function () { + const isReact16App = isReact16(); + if (isReact16App) { + this.skip(); + } + }); + + beforeEach(async function () { + // set cookie and reload which loads the form fields with default values + await page.evaluate(() => + window.localStorage.setItem("SIGNUP_SETTING_TYPE", "CUSTOM_FIELDS_WITH_DEFAULT_VALUES") + ); + + await page.reload({ + waitUntil: "domcontentloaded", + }); + await toggleSignInSignUp(page); + }); + + it("Check if default values are set already", async function () { + const fieldsWithDefault = { + country: "India", + "select-dropdown": "option 2", + terms: true, + }; + + // regular input field default value + const countryInput = await getInputField(page, "country"); + const defaultCountry = await countryInput.evaluate((f) => f.value); + assert.strictEqual(defaultCountry, fieldsWithDefault["country"]); + + // custom dropdown default value is also getting set correctly + const selectDropdown = await waitForSTElement(page, "select"); + const defaultOption = await selectDropdown.evaluate((f) => f.value); + assert.strictEqual(defaultOption, fieldsWithDefault["select-dropdown"]); + + // custom dropdown default value is also getting set correctly + const termsCheckbox = await waitForSTElement(page, '[name="terms"]'); + // checkbox is checked + const defaultChecked = await termsCheckbox.evaluate((f) => f.checked); + assert.strictEqual(defaultChecked, fieldsWithDefault["terms"]); + // also the value = string + const defaultValue = await termsCheckbox.evaluate((f) => f.value); + assert.strictEqual(defaultValue, fieldsWithDefault["terms"].toString()); + }); + + it("Check if changing the field value actually overwrites the default value", async function () { + const updatedFields = { + country: "USA", + "select-dropdown": "option 3", + }; + + await setInputValues(page, [{ name: "country", value: updatedFields["country"] }]); + await setSelectDropdownValue(page, "select", updatedFields["select-dropdown"]); + + // input field default value + const countryInput = await getInputField(page, "country"); + const updatedCountry = await countryInput.evaluate((f) => f.value); + assert.strictEqual(updatedCountry, updatedFields["country"]); + + // dropdown default value is also getting set correctly + const selectDropdown = await waitForSTElement(page, "select"); + const updatedOption = await selectDropdown.evaluate((f) => f.value); + assert.strictEqual(updatedOption, updatedFields["select-dropdown"]); + }); + + it("Check if default values are getting sent in signup-payload", async function () { + // directly submit the form and test the payload + const expectedDefautlValues = [ + { id: "email", value: "test@one.com" }, + { id: "password", value: "fakepassword123" }, + { id: "terms", value: "true" }, + { id: "select-dropdown", value: "option 2" }, + { id: "country", value: "India" }, + ]; + + let assertionError = null; + let interceptionPassed = false; + + const requestHandler = async (request) => { + if (request.url().includes(SIGN_UP_API) && request.method() === "POST") { + try { + const postData = JSON.parse(request.postData()); + expectedDefautlValues.forEach(({ id, value }) => { + let findFormData = postData.formFields.find((inputData) => inputData.id === id); + if (findFormData) { + assert.strictEqual(findFormData["value"], value, `Mismatch in payload for key: ${id}`); + } else { + throw new Error("Field not found in req.data"); + } + }); + interceptionPassed = true; + return request.respond({ + status: 200, + headers: { + "access-control-allow-origin": TEST_CLIENT_BASE_URL, + "access-control-allow-credentials": "true", + }, + body: JSON.stringify({ + status: "OK", + }), + }); + } catch (error) { + assertionError = error; // Store the error + } + } + return request.continue(); + }; + + await page.setRequestInterception(true); + page.on("request", requestHandler); + + try { + // Perform the button click and wait for all network activity to finish + await Promise.all([page.waitForNetworkIdle(), submitForm(page)]); + } finally { + page.off("request", requestHandler); + await page.setRequestInterception(false); + } + + if (assertionError) { + throw assertionError; + } + + if (!interceptionPassed) { + throw new Error("test failed"); + } + }); + }); + + describe("Third Party signup config Incorrect field message test", function () { + before(function () { + const isReact16App = isReact16(); + if (isReact16App) { + this.skip(); + } + }); + + beforeEach(async function () { + // set cookie and reload which loads the form fields with default values + await page.evaluate(() => window.localStorage.setItem("SIGNUP_SETTING_TYPE", "INCORRECT_FIELDS")); + + await page.reload({ + waitUntil: "domcontentloaded", + }); + }); + + it("Check if incorrect getDefaultValue throws error", async function () { + await page.evaluate(() => window.localStorage.setItem("SIGNUP_SETTING_TYPE", "INCORRECT_GETDEFAULT")); + let pageErrorMessage = ""; + page.on("pageerror", (err) => { + pageErrorMessage = err.message; + }); + + await page.reload({ + waitUntil: "domcontentloaded", + }); + await toggleSignInSignUp(page); + + const expectedErrorMessage = "getDefaultValue for country must return a string"; + assert( + pageErrorMessage.includes(expectedErrorMessage), + `Expected "${expectedErrorMessage}" to be included in page-error` + ); + }); + + it("Check if non-string params to onChange throws error", async function () { + await page.evaluate(() => window.localStorage.setItem("SIGNUP_SETTING_TYPE", "INCORRECT_ONCHANGE")); + await page.reload({ + waitUntil: "domcontentloaded", + }); + await toggleSignInSignUp(page); + + let pageErrorMessage = ""; + page.on("pageerror", (err) => { + pageErrorMessage = err.message; + }); + + // check terms and condition checkbox since it emits non-string value => boolean + let termsCheckbox = await waitForSTElement(page, '[name="terms"]'); + await page.evaluate((e) => e.click(), termsCheckbox); + + const expectedErrorMessage = "terms value must be a string"; + assert( + pageErrorMessage.includes(expectedErrorMessage), + `Expected "${expectedErrorMessage}" to be included in page-error` + ); + }); + + it("Check if empty string for nonOptionalErrorMsg throws error", async function () { + const expectedErrorMessage = "nonOptionalErrorMsg for field city cannot be an empty string"; + let pageErrorMessage = ""; + page.on("pageerror", (err) => { + pageErrorMessage = err.message; + }); + + await page.evaluate(() => + window.localStorage.setItem("SIGNUP_SETTING_TYPE", "INCORRECT_NON_OPTIONAL_ERROR_MSG") + ); + await page.reload({ + waitUntil: "domcontentloaded", + }); + + if (pageErrorMessage !== "") { + assert( + pageErrorMessage.includes(expectedErrorMessage), + `Expected "${expectedErrorMessage}" to be included in page-error` + ); + } else { + throw "Empty nonOptionalErrorMsg should throw error"; + } + }); + }); }); diff --git a/test/helpers.js b/test/helpers.js index bc7138534..b24ff29ed 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -417,6 +417,11 @@ export async function setInputValues(page, fields) { return await new Promise((r) => setTimeout(r, 300)); } +export async function setSelectDropdownValue(page, selector, optionValue) { + const dropdownEle = await waitForSTElement(page, selector); + return dropdownEle.select(selector, optionValue); +} + export async function clearBrowserCookiesWithoutAffectingConsole(page, console) { let toReturn = [...console]; const client = await page.target().createCDPSession(); diff --git a/test/with-typescript/src/App.tsx b/test/with-typescript/src/App.tsx index 65b0a3a5d..25ee1151f 100644 --- a/test/with-typescript/src/App.tsx +++ b/test/with-typescript/src/App.tsx @@ -339,6 +339,14 @@ function getEmailPasswordConfigs() { signInAndUpFeature: { signInForm: { style: theme.style, + formFields: [ + { + id: "email", + label: "Email", + nonOptionalErrorMsg: "Please add your email", + getDefaultValue: () => "abc@xyz.com", + }, + ], }, signUpForm: { style: theme.style, @@ -373,6 +381,72 @@ function getEmailPasswordConfigs() { placeholder: "Where do you live?", optional: true, }, + { + id: "terms", + label: "", + optional: false, + nonOptionalErrorMsg: "Please check Terms and conditions", + getDefaultValue: () => "true", + inputComponent: (inputProps) => ( +

+ { + if (inputProps.onChange) { + inputProps.onChange(e.target.checked.toString()); + } + }}> + I agree to the terms and conditions +
+ ), + validate: async (value) => { + if (value === "true") { + return undefined; + } + return "Please check Terms and conditions"; + }, + }, + { + id: "select", + label: "Select", + getDefaultValue: () => "option 2", + inputComponent: (inputProps) => ( + + ), + optional: true, + }, ], }, }, @@ -487,9 +561,115 @@ function getThirdPartyEmailPasswordConfigs() { }, signInAndUpFeature: { style: theme.style, + signInForm: { + formFields: [ + { + id: "email", + label: "Email", + nonOptionalErrorMsg: "Please add your email", + getDefaultValue: () => "abc@xyz.com", + }, + ], + }, signUpForm: { privacyPolicyLink: "https://supertokens.io/legal/privacy-policy", termsOfServiceLink: "https://supertokens.io/legal/terms-and-conditions", + formFields: [ + { + id: "email", + label: "Your Email", + placeholder: "Your work email", + }, + { + id: "name", + label: "Full name", + placeholder: "First name and last name", + }, + { + id: "age", + label: "Your age", + placeholder: "How old are you?", + validate: async (value) => { + if (parseInt(value) > 18) { + return undefined; + } + + return "You must be over 18 to register"; + }, + }, + { + id: "country", + label: "Your Country", + placeholder: "Where do you live?", + optional: true, + }, + { + id: "terms", + label: "", + optional: false, + nonOptionalErrorMsg: "Please check Terms and conditions", + getDefaultValue: () => "true", + inputComponent: (inputProps) => ( +
+ { + if (inputProps.onChange) { + inputProps.onChange(e.target.checked.toString()); + } + }}> + I agree to the terms and conditions +
+ ), + validate: async (value) => { + if (value === "true") { + return undefined; + } + return "Please check Terms and conditions"; + }, + }, + { + id: "select", + label: "Select", + getDefaultValue: () => "option 2", + inputComponent: (inputProps) => ( + + ), + optional: true, + }, + ], }, providers: [ ThirdPartyEmailPassword.Github.init(), From 3e7f43913bcf954a88b3301cb44674037e069a13 Mon Sep 17 00:00:00 2001 From: rishabhpoddar Date: Thu, 23 Nov 2023 15:11:52 +0530 Subject: [PATCH 04/12] adding dev-v0.35.7 tag to this commit to ensure building --- docs/classes/index.default.html | 2 +- docs/classes/recipe_authRecipe.default.html | 2 +- docs/classes/recipe_emailpassword.default.html | 2 +- docs/classes/recipe_emailverification.default.html | 2 +- docs/classes/recipe_multitenancy.default.html | 2 +- docs/classes/recipe_passwordless.default.html | 2 +- docs/classes/recipe_recipeModule.default.html | 2 +- docs/classes/recipe_session.BooleanClaim.html | 2 +- docs/classes/recipe_session.PrimitiveArrayClaim.html | 2 +- docs/classes/recipe_session.PrimitiveClaim.html | 2 +- docs/classes/recipe_session.default.html | 2 +- docs/classes/recipe_thirdparty.ActiveDirectory.html | 2 +- docs/classes/recipe_thirdparty.Apple.html | 2 +- docs/classes/recipe_thirdparty.Bitbucket.html | 2 +- docs/classes/recipe_thirdparty.BoxySAML.html | 2 +- docs/classes/recipe_thirdparty.Discord.html | 2 +- docs/classes/recipe_thirdparty.Facebook.html | 2 +- docs/classes/recipe_thirdparty.Github.html | 2 +- docs/classes/recipe_thirdparty.Gitlab.html | 2 +- docs/classes/recipe_thirdparty.Google.html | 2 +- docs/classes/recipe_thirdparty.GoogleWorkspaces.html | 2 +- docs/classes/recipe_thirdparty.LinkedIn.html | 2 +- docs/classes/recipe_thirdparty.Okta.html | 2 +- docs/classes/recipe_thirdparty.Twitter.html | 2 +- docs/classes/recipe_thirdparty.default.html | 2 +- docs/classes/recipe_thirdpartyemailpassword.default.html | 2 +- docs/classes/recipe_thirdpartypasswordless.default.html | 2 +- docs/classes/recipe_userroles.default.html | 2 +- docs/modules/index.html | 2 +- docs/modules/recipe_emailpassword.html | 4 ++-- docs/modules/recipe_emailverification.html | 4 ++-- docs/modules/recipe_multitenancy.html | 2 +- docs/modules/recipe_passwordless.html | 4 ++-- docs/modules/recipe_session.html | 4 ++-- docs/modules/recipe_thirdparty.html | 4 ++-- docs/modules/recipe_thirdpartyemailpassword.html | 4 ++-- docs/modules/recipe_thirdpartypasswordless.html | 4 ++-- .../themes/resetPasswordUsingToken/submitNewPassword.d.ts | 2 +- .../components/themes/signInAndUp/signIn.d.ts | 4 ++-- .../components/themes/signInAndUp/signUp.d.ts | 7 ++++--- .../components/themes/translations.d.ts | 6 ------ .../components/themes/translations.d.ts | 5 ----- 42 files changed, 51 insertions(+), 61 deletions(-) diff --git a/docs/classes/index.default.html b/docs/classes/index.default.html index 173857a19..730466463 100644 --- a/docs/classes/index.default.html +++ b/docs/classes/index.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

SuperTokensWrapper: FC<PropsWithChildren<{ userContext?: any }>> = SuperTokensWrapper
useTranslation: (() => TranslationFunc) = useTranslation

Type declaration

    • (): TranslationFunc
    • Returns TranslationFunc

useUserContext: (() => any) = useUserContext

Type declaration

    • (): any
    • Returns any

Methods

  • changeLanguage(language: string): Promise<void>
  • init(config: SuperTokensConfig): void
  • loadTranslation(store: TranslationStore): void
  • redirectToAuth(options?: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }): Promise<void>
  • Parameters

    • Optional options: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }
      • Optional history?: any
      • Optional queryParams?: any
      • Optional redirectBack?: boolean
      • Optional show?: "signin" | "signup"

    Returns Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

SuperTokensWrapper: FC<PropsWithChildren<{ userContext?: any }>> = SuperTokensWrapper
useTranslation: (() => TranslationFunc) = useTranslation

Type declaration

    • (): TranslationFunc
    • Returns TranslationFunc

useUserContext: (() => any) = useUserContext

Type declaration

    • (): any
    • Returns any

Methods

  • changeLanguage(language: string): Promise<void>
  • init(config: SuperTokensConfig): void
  • loadTranslation(store: TranslationStore): void
  • redirectToAuth(options?: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }): Promise<void>
  • Parameters

    • Optional options: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }
      • Optional history?: any
      • Optional queryParams?: any
      • Optional redirectBack?: boolean
      • Optional show?: "signin" | "signup"

    Returns Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

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 44ba99db0..d20c27c50 100644 --- a/docs/classes/recipe_authRecipe.default.html +++ b/docs/classes/recipe_authRecipe.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<T, Action, R, N> Abstract

Type Parameters

  • T

  • Action

  • R

  • N extends NormalisedConfig<T | GetRedirectionURLContext, Action, R | OnHandleEventContext>

Hierarchy

  • default<T | GetRedirectionURLContext, Action, R | OnHandleEventContext, N>
    • default

Index

Constructors

  • new default<T, Action, R, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<T, Action, R, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • doesSessionExist(input?: { userContext?: any }): Promise<boolean>
  • getAuthRecipeDefaultRedirectionURL(context: GetRedirectionURLContext): Promise<string>
  • getDefaultRedirectionURL(_: GetRedirectionURLContext | T): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>
  • signOut(input?: { userContext?: any }): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property
  • Inherited method

Settings

Theme

Generated using TypeDoc

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

Class default<T, Action, R, N> Abstract

Type Parameters

  • T

  • Action

  • R

  • N extends NormalisedConfig<T | GetRedirectionURLContext, Action, R | OnHandleEventContext>

Hierarchy

  • default<T | GetRedirectionURLContext, Action, R | OnHandleEventContext, N>
    • default

Index

Constructors

  • new default<T, Action, R, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<T, Action, R, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • doesSessionExist(input?: { userContext?: any }): Promise<boolean>
  • getAuthRecipeDefaultRedirectionURL(context: GetRedirectionURLContext): Promise<string>
  • getDefaultRedirectionURL(_: GetRedirectionURLContext | T): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>
  • signOut(input?: { userContext?: any }): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property
  • Inherited method

Settings

Theme

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 f06643696..bc5ed5c1d 100644 --- a/docs/classes/recipe_emailpassword.default.html +++ b/docs/classes/recipe_emailpassword.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

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

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

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

  • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

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

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

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

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

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

  • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

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

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

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 2796ce2f3..d0a889f56 100644 --- a/docs/classes/recipe_emailverification.default.html +++ b/docs/classes/recipe_emailverification.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider
EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationRecipe.EmailVerificationClaim

Methods

  • getEmailVerificationTokenFromURL(input?: { userContext?: any }): string
  • isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>
  • Parameters

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

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

  • sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • Parameters

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

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

  • verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
  • Parameters

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider
EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationRecipe.EmailVerificationClaim

Methods

  • getEmailVerificationTokenFromURL(input?: { userContext?: any }): string
  • isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>
  • Parameters

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

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

  • sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • Parameters

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

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

  • verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
  • Parameters

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_multitenancy.default.html b/docs/classes/recipe_multitenancy.default.html index 327c1b18e..1f4e1b36a 100644 --- a/docs/classes/recipe_multitenancy.default.html +++ b/docs/classes/recipe_multitenancy.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

AllowedDomainsClaim: AllowedDomainsClaimClass = AllowedDomainsClaim
ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

AllowedDomainsClaim: AllowedDomainsClaimClass = AllowedDomainsClaim
ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_passwordless.default.html b/docs/classes/recipe_passwordless.default.html index c8fb24fec..bb59a6ae4 100644 --- a/docs/classes/recipe_passwordless.default.html +++ b/docs/classes/recipe_passwordless.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

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

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

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

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

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

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

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

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

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

    • CustomLoginAttemptInfoProperties

    Parameters

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

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

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

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

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

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

    • CustomStateProperties

    Parameters

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

    Returns Promise<void>

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

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

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

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

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

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

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

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

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

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

    • CustomLoginAttemptInfoProperties

    Parameters

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

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

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

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

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

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

    • CustomStateProperties

    Parameters

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

    Returns Promise<void>

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_recipeModule.default.html b/docs/classes/recipe_recipeModule.default.html index 781934ba0..7169a6533 100644 --- a/docs/classes/recipe_recipeModule.default.html +++ b/docs/classes/recipe_recipeModule.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N> Abstract

Type Parameters

  • GetRedirectionURLContextType

  • Action

  • OnHandleEventContextType

  • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

Hierarchy

  • BaseRecipeModule<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Index

Constructors

  • new default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>
  • Type Parameters

    • GetRedirectionURLContextType

    • Action

    • OnHandleEventContextType

    • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

    Parameters

    • config: NormalisedConfigWithAppInfoAndRecipeID<N>

    Returns default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • getDefaultRedirectionURL(_: GetRedirectionURLContextType): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property

Settings

Theme

Generated using TypeDoc

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

Class default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N> Abstract

Type Parameters

  • GetRedirectionURLContextType

  • Action

  • OnHandleEventContextType

  • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

Hierarchy

  • BaseRecipeModule<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Index

Constructors

  • new default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>
  • Type Parameters

    • GetRedirectionURLContextType

    • Action

    • OnHandleEventContextType

    • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

    Parameters

    • config: NormalisedConfigWithAppInfoAndRecipeID<N>

    Returns default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • getDefaultRedirectionURL(_: GetRedirectionURLContextType): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_session.BooleanClaim.html b/docs/classes/recipe_session.BooleanClaim.html index 08f1262fd..6e71b0462 100644 --- a/docs/classes/recipe_session.BooleanClaim.html +++ b/docs/classes/recipe_session.BooleanClaim.html @@ -1,3 +1,3 @@ -BooleanClaim | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • BooleanClaim
    • BooleanClaim

Index

Constructors

  • new BooleanClaim(config: PrimitiveClaimConfig & { onFailureRedirection?: ValidationFailureCallback; showAccessDeniedOnFailure?: boolean }): BooleanClaim
  • Parameters

    • config: PrimitiveClaimConfig & { onFailureRedirection?: ValidationFailureCallback; showAccessDeniedOnFailure?: boolean }

    Returns BooleanClaim

Properties

defaultMaxAgeInSeconds: undefined | number
id: string
refresh: ((userContext: any) => Promise<void>)

Type declaration

UserInput: { override?: { functions?: any } } & RecipeModuleUserInput<any, PreAndPostAPIHookAction, any>

Variables

AllowedDomainsClaim: AllowedDomainsClaimClass
MultitenancyComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

Functions

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

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 diff --git a/docs/modules/recipe_passwordless.html b/docs/modules/recipe_passwordless.html index a4cb7662a..7ca341c5e 100644 --- a/docs/modules/recipe_passwordless.html +++ b/docs/modules/recipe_passwordless.html @@ -1,4 +1,4 @@ -recipe/passwordless | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

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

Type declaration

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

Type declaration

  • clearLoginAttemptInfo:function
    • clearLoginAttemptInfo(input: { userContext: any }): Promise<void>
    • +recipe/passwordless | supertokens-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Type Aliases

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

      Type declaration

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

      Type declaration

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

          Parameters

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

          Returns Promise<void>

      • consumeCode:function
        • consumeCode(input: { deviceId: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any; userInputCode: string } | { linkCode: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
        • Log the user in using the input code or link code

          @@ -34,4 +34,4 @@

          Parameters

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

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

          {status: "OK"} if succesful

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

          -

          Type Parameters

          • CustomStateProperties

          Parameters

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

          Returns Promise<void>

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

      Variables

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

      Functions

      • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
      • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

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

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

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

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

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

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

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

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

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

        • CustomLoginAttemptInfoProperties

        Parameters

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

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

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

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

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

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

        • CustomStateProperties

        Parameters

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

        Returns Promise<void>

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

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

      Returns Promise<void>

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

Variables

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

Functions

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

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

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

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

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

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

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

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

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

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

    • CustomLoginAttemptInfoProperties

    Parameters

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

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

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

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

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

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

    • CustomStateProperties

    Parameters

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

    Returns Promise<void>

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

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 diff --git a/docs/modules/recipe_session.html b/docs/modules/recipe_session.html index 7f6a58fef..849b1f4e9 100644 --- a/docs/modules/recipe_session.html +++ b/docs/modules/recipe_session.html @@ -1,8 +1,8 @@ -recipe/session | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

ClaimValidationError: { reason?: any; validatorId: string }

Type declaration

  • Optional reason?: any
  • validatorId: string
ClaimValidationResult: { isValid: true } | { isValid: false; reason?: any }
InputType: WebJSInputType & { accessDeniedScreen?: SessionFeatureBaseConfig; style?: string; onHandleEvent?: any }
RecipeInterface: { addAxiosInterceptors: any; addFetchInterceptorsAndReturnModifiedFetch: any; addXMLHttpRequestInterceptor: any; doesSessionExist: any; getAccessTokenPayloadSecurely: any; getGlobalClaimValidators: any; getInvalidClaimsFromResponse: any; getUserId: any; shouldDoInterceptionBasedOnUrl: any; signOut: any; validateClaims: any }

Type declaration

  • addAxiosInterceptors:function
    • addAxiosInterceptors(input: { axiosInstance: any; userContext: any }): void
    • Parameters

      • input: { axiosInstance: any; userContext: any }
        • axiosInstance: any
        • userContext: any

      Returns void

  • addFetchInterceptorsAndReturnModifiedFetch:function
    • addFetchInterceptorsAndReturnModifiedFetch(input: { originalFetch: any; userContext: any }): ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)
    • Parameters

      • input: { originalFetch: any; userContext: any }
        • originalFetch: any
        • userContext: any

      Returns ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)

        • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
        • Parameters

          • input: URL | RequestInfo
          • Optional init: RequestInit

          Returns Promise<Response>

  • addXMLHttpRequestInterceptor:function
    • addXMLHttpRequestInterceptor(input: { userContext: any }): void
    • Parameters

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

      Returns void

  • doesSessionExist:function
    • doesSessionExist(input: { userContext: any }): Promise<boolean>
    • Parameters

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

      Returns Promise<boolean>

  • getAccessTokenPayloadSecurely:function
    • getAccessTokenPayloadSecurely(input: { userContext: any }): Promise<any>
    • Parameters

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

      Returns Promise<any>

  • getGlobalClaimValidators:function
  • getInvalidClaimsFromResponse:function
    • getInvalidClaimsFromResponse(input: { response: { data: any } | Response; userContext: any }): Promise<ClaimValidationError[]>
    • Parameters

      • input: { response: { data: any } | Response; userContext: any }
        • response: { data: any } | Response
        • userContext: any

      Returns Promise<ClaimValidationError[]>

  • getUserId:function
    • getUserId(input: { userContext: any }): Promise<string>
    • Parameters

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

      Returns Promise<string>

  • shouldDoInterceptionBasedOnUrl:function
    • shouldDoInterceptionBasedOnUrl(toCheckUrl: string, apiDomain: string, sessionTokenBackendDomain: undefined | string): boolean
    • Parameters

      • toCheckUrl: string
      • apiDomain: string
      • sessionTokenBackendDomain: undefined | string

      Returns boolean

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

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

      Returns Promise<void>

  • validateClaims:function
SessionClaim<ValueType>: { getLastFetchedTime: any; getValueFromPayload: any; refresh: any }

Type Parameters

  • ValueType

Type declaration

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

      • payload: any
      • Optional _userContext: any

      Returns undefined | number

  • getValueFromPayload:function
    • getValueFromPayload(payload: any, _userContext?: any): undefined | ValueType
    • Parameters

      • payload: any
      • Optional _userContext: any

      Returns undefined | ValueType

  • refresh:function
    • refresh(userContext: any): Promise<void>
    • Parameters

      • userContext: any

      Returns Promise<void>

SessionClaimValidator: { id: string; refresh: any; shouldRefresh: any; validate: any }

Type declaration

  • Readonly id: string
  • refresh:function
    • refresh(userContext: any): Promise<void>
    • +recipe/session | supertokens-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Type Aliases

      ClaimValidationError: { reason?: any; validatorId: string }

      Type declaration

      • Optional reason?: any
      • validatorId: string
      ClaimValidationResult: { isValid: true } | { isValid: false; reason?: any }
      InputType: WebJSInputType & { accessDeniedScreen?: SessionFeatureBaseConfig; style?: string; onHandleEvent?: any }
      RecipeInterface: { addAxiosInterceptors: any; addFetchInterceptorsAndReturnModifiedFetch: any; addXMLHttpRequestInterceptor: any; doesSessionExist: any; getAccessTokenPayloadSecurely: any; getGlobalClaimValidators: any; getInvalidClaimsFromResponse: any; getUserId: any; shouldDoInterceptionBasedOnUrl: any; signOut: any; validateClaims: any }

      Type declaration

      • addAxiosInterceptors:function
        • addAxiosInterceptors(input: { axiosInstance: any; userContext: any }): void
        • Parameters

          • input: { axiosInstance: any; userContext: any }
            • axiosInstance: any
            • userContext: any

          Returns void

      • addFetchInterceptorsAndReturnModifiedFetch:function
        • addFetchInterceptorsAndReturnModifiedFetch(input: { originalFetch: any; userContext: any }): ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)
        • Parameters

          • input: { originalFetch: any; userContext: any }
            • originalFetch: any
            • userContext: any

          Returns ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)

            • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
            • Parameters

              • input: URL | RequestInfo
              • Optional init: RequestInit

              Returns Promise<Response>

      • addXMLHttpRequestInterceptor:function
        • addXMLHttpRequestInterceptor(input: { userContext: any }): void
        • Parameters

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

          Returns void

      • doesSessionExist:function
        • doesSessionExist(input: { userContext: any }): Promise<boolean>
        • Parameters

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

          Returns Promise<boolean>

      • getAccessTokenPayloadSecurely:function
        • getAccessTokenPayloadSecurely(input: { userContext: any }): Promise<any>
        • Parameters

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

          Returns Promise<any>

      • getGlobalClaimValidators:function
      • getInvalidClaimsFromResponse:function
        • getInvalidClaimsFromResponse(input: { response: { data: any } | Response; userContext: any }): Promise<ClaimValidationError[]>
        • Parameters

          • input: { response: { data: any } | Response; userContext: any }
            • response: { data: any } | Response
            • userContext: any

          Returns Promise<ClaimValidationError[]>

      • getUserId:function
        • getUserId(input: { userContext: any }): Promise<string>
        • Parameters

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

          Returns Promise<string>

      • shouldDoInterceptionBasedOnUrl:function
        • shouldDoInterceptionBasedOnUrl(toCheckUrl: string, apiDomain: string, sessionTokenBackendDomain: undefined | string): boolean
        • Parameters

          • toCheckUrl: string
          • apiDomain: string
          • sessionTokenBackendDomain: undefined | string

          Returns boolean

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

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

          Returns Promise<void>

      • validateClaims:function
      SessionClaim<ValueType>: { getLastFetchedTime: any; getValueFromPayload: any; refresh: any }

      Type Parameters

      • ValueType

      Type declaration

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

          • payload: any
          • Optional _userContext: any

          Returns undefined | number

      • getValueFromPayload:function
        • getValueFromPayload(payload: any, _userContext?: any): undefined | ValueType
        • Parameters

          • payload: any
          • Optional _userContext: any

          Returns undefined | ValueType

      • refresh:function
        • refresh(userContext: any): Promise<void>
        • Parameters

          • userContext: any

          Returns Promise<void>

      SessionClaimValidator: { id: string; refresh: any; shouldRefresh: any; validate: any }

      Type declaration

      • Readonly id: string
      • refresh:function
        • refresh(userContext: any): Promise<void>
        • Makes an API call that will refresh the claim in the token.

          Parameters

          • userContext: any

          Returns Promise<void>

      • shouldRefresh:function
        • shouldRefresh(accessTokenPayload: any, userContext: any): boolean | Promise<boolean>
        • Decides if we need to refresh the claim value before checking the payload with validate. E.g.: if the information in the payload is expired, or is not sufficient for this validator.

          Parameters

          • accessTokenPayload: any
          • userContext: any

          Returns boolean | Promise<boolean>

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

      SessionContextType: LoadedSessionContext | { loading: true }

      Variables

      SessionAuth: FC<PropsWithChildren<SessionAuthProps & { userContext?: any }>> = SessionAPIWrapper.SessionAuth
      SessionComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = SessionAPIWrapper.ComponentsOverrideProvider
      SessionContext: Context<{ accessDeniedValidatorError?: ClaimValidationError; invalidClaims: ClaimValidationError[]; loading: false } & SessionContextUpdate & { isDefault?: boolean } & { loading: true } & { isDefault?: boolean }> = ...

      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?: InputType): RecipeInitResult<unknown, unknown, unknown, any>
      • signOut(input?: { userContext?: any }): Promise<void>
      • useClaimValue<T>(claim: SessionClaim<T>): { loading: true } | { doesSessionExist: boolean; loading: false; value: undefined | T }

      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 +

      Parameters

      • accessTokenPayload: any
      • userContext: any

      Returns ClaimValidationResult | Promise<ClaimValidationResult>

SessionContextType: LoadedSessionContext | { loading: true }

Variables

SessionAuth: FC<PropsWithChildren<SessionAuthProps & { userContext?: any }>> = SessionAPIWrapper.SessionAuth
SessionComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = SessionAPIWrapper.ComponentsOverrideProvider
SessionContext: Context<{ accessDeniedValidatorError?: ClaimValidationError; invalidClaims: ClaimValidationError[]; loading: false } & SessionContextUpdate & { isDefault?: boolean } & { loading: true } & { isDefault?: boolean }> = ...

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?: InputType): RecipeInitResult<unknown, unknown, unknown, any>
  • signOut(input?: { userContext?: any }): Promise<void>
  • useClaimValue<T>(claim: SessionClaim<T>): { loading: true } | { doesSessionExist: boolean; loading: false; value: undefined | T }

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 diff --git a/docs/modules/recipe_thirdparty.html b/docs/modules/recipe_thirdparty.html index cb74e2589..fce5e7e9e 100644 --- a/docs/modules/recipe_thirdparty.html +++ b/docs/modules/recipe_thirdparty.html @@ -1,4 +1,4 @@ -recipe/thirdparty | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

GetRedirectionURLContext: AuthRecipeModuleGetRedirectionURLContext
OnHandleEventContext: AuthRecipeModuleOnHandleEventContext | { action: "SUCCESS"; isNewRecipeUser: boolean; user: User; userContext: any }
PreAPIHookContext: { action: PreAndPostAPIHookAction; requestInit: RequestInit; url: string; userContext: any }

Type declaration

  • action: PreAndPostAPIHookAction
  • requestInit: RequestInit
  • url: string
  • userContext: any
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-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Type Aliases

      GetRedirectionURLContext: AuthRecipeModuleGetRedirectionURLContext
      OnHandleEventContext: AuthRecipeModuleOnHandleEventContext | { action: "SUCCESS"; isNewRecipeUser: boolean; user: User; userContext: any }
      PreAPIHookContext: { action: PreAndPostAPIHookAction; requestInit: RequestInit; url: string; userContext: any }

      Type declaration

      • action: PreAndPostAPIHookAction
      • requestInit: RequestInit
      • url: string
      • userContext: any
      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
        • @@ -26,4 +26,4 @@

          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

      • 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: { oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

      Variables

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

      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
      • Type Parameters

        • CustomStateProperties

        Parameters

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

        Returns undefined | StateObject & CustomStateProperties

      • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
      • Parameters

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

        Returns Promise<{ status: "OK" | "ERROR" }>

      • 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

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

        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>

UserInput: { oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

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

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
  • Type Parameters

    • CustomStateProperties

    Parameters

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

    Returns undefined | StateObject & CustomStateProperties

  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
  • Parameters

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

    Returns Promise<{ status: "OK" | "ERROR" }>

  • 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

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

    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 diff --git a/docs/modules/recipe_thirdpartyemailpassword.html b/docs/modules/recipe_thirdpartyemailpassword.html index c898aadc1..88b3646a4 100644 --- a/docs/modules/recipe_thirdpartyemailpassword.html +++ b/docs/modules/recipe_thirdpartyemailpassword.html @@ -1,4 +1,4 @@ -recipe/thirdpartyemailpassword | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/thirdpartyemailpassword

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: { 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-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Module recipe/thirdpartyemailpassword

      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: { 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" }>
        • Check if an 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}

          @@ -51,4 +51,4 @@

          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

      • 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: { disableEmailPassword?: boolean; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; resetPasswordUsingTokenFeature?: ResetPasswordUsingTokenUserInput; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

      Variables

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

      Functions

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

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

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

      • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
      • getStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
      • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
      • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "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" }>
      • Parameters

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

        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: { disableEmailPassword?: boolean; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; resetPasswordUsingTokenFeature?: ResetPasswordUsingTokenUserInput; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

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

Functions

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

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

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

  • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
  • getStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "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" }>
  • Parameters

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

    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 diff --git a/docs/modules/recipe_thirdpartypasswordless.html b/docs/modules/recipe_thirdpartypasswordless.html index 3d83fa41c..56051da9c 100644 --- a/docs/modules/recipe_thirdpartypasswordless.html +++ b/docs/modules/recipe_thirdpartypasswordless.html @@ -1,4 +1,4 @@ -recipe/thirdpartypasswordless | supertokens-auth-react
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>
    • +recipe/thirdpartypasswordless | supertokens-auth-react
      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

          @@ -62,4 +62,4 @@

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

      Variables

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

      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

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

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

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

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

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

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

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

        Returns 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 } & CustomLoginAttemptInfoProperties>
      • Type Parameters

        • CustomLoginAttemptInfoProperties

        Parameters

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

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

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

      • getThirdPartyStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
      • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
      • resendPasswordlessCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
      • Parameters

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

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

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

        • CustomStateProperties

        Parameters

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

        Returns Promise<void>

      • signOut(input?: { userContext?: any }): Promise<void>
      • thirdPartySignInAndUp(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

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

        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: ({ 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; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any } } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

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

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

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

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

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

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

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

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

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

    Returns 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 } & CustomLoginAttemptInfoProperties>
  • Type Parameters

    • CustomLoginAttemptInfoProperties

    Parameters

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

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

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

  • getThirdPartyStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
  • resendPasswordlessCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
  • Parameters

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

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

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

    • CustomStateProperties

    Parameters

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

    Returns Promise<void>

  • signOut(input?: { userContext?: any }): Promise<void>
  • thirdPartySignInAndUp(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

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

    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 diff --git a/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts b/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts index 9c795dce2..b8ec36fd7 100644 --- a/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts @@ -1,7 +1,7 @@ /// export declare const SubmitNewPassword: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { - formFields: Omit[]; + formFields: import("../../../types").FormFieldThemeProps[]; error: string | undefined; } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; diff --git a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts index 64639bb96..46dd93ed6 100644 --- a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts @@ -1,7 +1,7 @@ /// export declare const SignIn: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { - formFields: Omit[]; + formFields: import("../../../types").FormFieldThemeProps[]; error: string | undefined; } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; @@ -10,6 +10,6 @@ export declare const SignIn: import("react").ComponentType< config: import("../../../types").NormalisedConfig; signUpClicked?: (() => void) | undefined; forgotPasswordClick: () => void; - onSuccess: (result: { user: import("supertokens-web-js/types").User }) => void; + onSuccess: () => void; } >; diff --git a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts index 32bc386b1..1a0268aa8 100644 --- a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts @@ -1,13 +1,14 @@ /// export declare const SignUp: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { + formFields: import("../../../types").FormFieldThemeProps[]; + error: string | undefined; + } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; clearError: () => void; onError: (error: string) => void; config: import("../../../types").NormalisedConfig; signInClicked?: (() => void) | undefined; - onSuccess: (result: { user: import("supertokens-web-js/types").User }) => void; - formFields: import("../../../types").FormFieldThemeProps[]; - error: string | undefined; + onSuccess: () => void; } >; diff --git a/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts b/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts index 454ff978e..bb256d116 100644 --- a/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts +++ b/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts @@ -58,9 +58,6 @@ export declare const defaultTranslationsThirdPartyEmailPassword: { "Password must contain at least one alphabet": undefined; "Password must contain at least one number": undefined; "Email is invalid": undefined; - "Reset password link was not created because of account take over risk. Please contact support. (ERR_CODE_001)": undefined; - "Cannot sign up due to security reasons. Please try logging in, use a different login method or contact support. (ERR_CODE_007)": undefined; - "Cannot sign in due to security reasons. Please try resetting your password, use a different login method or contact support. (ERR_CODE_008)": undefined; EMAIL_VERIFICATION_RESEND_SUCCESS: string; EMAIL_VERIFICATION_SEND_TITLE: string; EMAIL_VERIFICATION_SEND_DESC_START: string; @@ -89,8 +86,5 @@ export declare const defaultTranslationsThirdPartyEmailPassword: { THIRD_PARTY_PROVIDER_DEFAULT_BTN_START: string; THIRD_PARTY_PROVIDER_DEFAULT_BTN_END: string; THIRD_PARTY_ERROR_NO_EMAIL: string; - "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_004)": undefined; - "Cannot sign in / up because new email cannot be applied to existing account. Please contact support. (ERR_CODE_005)": undefined; - "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_006)": undefined; }; }; diff --git a/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts b/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts index b24b59e60..dbe4e941e 100644 --- a/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts +++ b/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts @@ -57,8 +57,6 @@ export declare const defaultTranslationsThirdPartyPasswordless: { "Failed to generate a one time code. Please try again": undefined; "Phone number is invalid": undefined; "Email is invalid": undefined; - "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_002)": undefined; - "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_003)": undefined; BRANDING_POWERED_BY_START: string; BRANDING_POWERED_BY_END: string; SOMETHING_WENT_WRONG_ERROR: string; @@ -71,8 +69,5 @@ export declare const defaultTranslationsThirdPartyPasswordless: { THIRD_PARTY_PROVIDER_DEFAULT_BTN_START: string; THIRD_PARTY_PROVIDER_DEFAULT_BTN_END: string; THIRD_PARTY_ERROR_NO_EMAIL: string; - "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_004)": undefined; - "Cannot sign in / up because new email cannot be applied to existing account. Please contact support. (ERR_CODE_005)": undefined; - "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_006)": undefined; }; }; From a0faff1a03947bffac11173b3603f02490bd7ac2 Mon Sep 17 00:00:00 2001 From: Amit Badala Date: Fri, 24 Nov 2023 10:41:54 +0530 Subject: [PATCH 05/12] Ensure correct recipie is set in the backend (#767) --- test/end-to-end/signin-rrdv5.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/end-to-end/signin-rrdv5.test.js b/test/end-to-end/signin-rrdv5.test.js index a69fb8ffb..3fca2dc03 100644 --- a/test/end-to-end/signin-rrdv5.test.js +++ b/test/end-to-end/signin-rrdv5.test.js @@ -50,6 +50,7 @@ import { waitForText, waitForSTElement, backendBeforeEach, + setEnabledRecipes, } from "../helpers"; import fetch from "isomorphic-fetch"; import { SOMETHING_WENT_WRONG_ERROR } from "../constants"; @@ -660,6 +661,7 @@ describe("SuperTokens SignIn => Server Error", function () { let consoleLogs; before(async function () { + await setEnabledRecipes(["emailpassword"], []); browser = await puppeteer.launch({ args: ["--no-sandbox", "--disable-setuid-sandbox"], headless: true, From 1baf355d045f1a1bb1fd757eab22e18220f7a6dd Mon Sep 17 00:00:00 2001 From: rishabhpoddar Date: Fri, 24 Nov 2023 10:42:26 +0530 Subject: [PATCH 06/12] adding dev-v0.35.7 tag to this commit to ensure building --- docs/classes/index.default.html | 2 +- docs/classes/recipe_authRecipe.default.html | 2 +- docs/classes/recipe_emailpassword.default.html | 2 +- docs/classes/recipe_emailverification.default.html | 2 +- docs/classes/recipe_multitenancy.default.html | 2 +- docs/classes/recipe_passwordless.default.html | 2 +- docs/classes/recipe_recipeModule.default.html | 2 +- docs/classes/recipe_session.BooleanClaim.html | 2 +- docs/classes/recipe_session.PrimitiveArrayClaim.html | 2 +- docs/classes/recipe_session.PrimitiveClaim.html | 2 +- docs/classes/recipe_session.default.html | 2 +- docs/classes/recipe_thirdparty.ActiveDirectory.html | 2 +- docs/classes/recipe_thirdparty.Apple.html | 2 +- docs/classes/recipe_thirdparty.Bitbucket.html | 2 +- docs/classes/recipe_thirdparty.BoxySAML.html | 2 +- docs/classes/recipe_thirdparty.Discord.html | 2 +- docs/classes/recipe_thirdparty.Facebook.html | 2 +- docs/classes/recipe_thirdparty.Github.html | 2 +- docs/classes/recipe_thirdparty.Gitlab.html | 2 +- docs/classes/recipe_thirdparty.Google.html | 2 +- docs/classes/recipe_thirdparty.GoogleWorkspaces.html | 2 +- docs/classes/recipe_thirdparty.LinkedIn.html | 2 +- docs/classes/recipe_thirdparty.Okta.html | 2 +- docs/classes/recipe_thirdparty.Twitter.html | 2 +- docs/classes/recipe_thirdparty.default.html | 2 +- docs/classes/recipe_thirdpartyemailpassword.default.html | 2 +- docs/classes/recipe_thirdpartypasswordless.default.html | 2 +- docs/classes/recipe_userroles.default.html | 2 +- docs/modules/index.html | 2 +- docs/modules/recipe_emailpassword.html | 4 ++-- docs/modules/recipe_emailverification.html | 4 ++-- docs/modules/recipe_multitenancy.html | 2 +- docs/modules/recipe_passwordless.html | 4 ++-- docs/modules/recipe_session.html | 4 ++-- docs/modules/recipe_thirdparty.html | 4 ++-- docs/modules/recipe_thirdpartyemailpassword.html | 4 ++-- docs/modules/recipe_thirdpartypasswordless.html | 4 ++-- 37 files changed, 44 insertions(+), 44 deletions(-) diff --git a/docs/classes/index.default.html b/docs/classes/index.default.html index 730466463..002826e4e 100644 --- a/docs/classes/index.default.html +++ b/docs/classes/index.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

SuperTokensWrapper: FC<PropsWithChildren<{ userContext?: any }>> = SuperTokensWrapper
useTranslation: (() => TranslationFunc) = useTranslation

Type declaration

    • (): TranslationFunc
    • Returns TranslationFunc

useUserContext: (() => any) = useUserContext

Type declaration

    • (): any
    • Returns any

Methods

  • changeLanguage(language: string): Promise<void>
  • init(config: SuperTokensConfig): void
  • loadTranslation(store: TranslationStore): void
  • redirectToAuth(options?: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }): Promise<void>
  • Parameters

    • Optional options: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }
      • Optional history?: any
      • Optional queryParams?: any
      • Optional redirectBack?: boolean
      • Optional show?: "signin" | "signup"

    Returns Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

SuperTokensWrapper: FC<PropsWithChildren<{ userContext?: any }>> = SuperTokensWrapper
useTranslation: (() => TranslationFunc) = useTranslation

Type declaration

    • (): TranslationFunc
    • Returns TranslationFunc

useUserContext: (() => any) = useUserContext

Type declaration

    • (): any
    • Returns any

Methods

  • changeLanguage(language: string): Promise<void>
  • init(config: SuperTokensConfig): void
  • loadTranslation(store: TranslationStore): void
  • redirectToAuth(options?: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }): Promise<void>
  • Parameters

    • Optional options: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }
      • Optional history?: any
      • Optional queryParams?: any
      • Optional redirectBack?: boolean
      • Optional show?: "signin" | "signup"

    Returns Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

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 d20c27c50..fe58ea1f5 100644 --- a/docs/classes/recipe_authRecipe.default.html +++ b/docs/classes/recipe_authRecipe.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<T, Action, R, N> Abstract

Type Parameters

  • T

  • Action

  • R

  • N extends NormalisedConfig<T | GetRedirectionURLContext, Action, R | OnHandleEventContext>

Hierarchy

  • default<T | GetRedirectionURLContext, Action, R | OnHandleEventContext, N>
    • default

Index

Constructors

  • new default<T, Action, R, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<T, Action, R, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • doesSessionExist(input?: { userContext?: any }): Promise<boolean>
  • getAuthRecipeDefaultRedirectionURL(context: GetRedirectionURLContext): Promise<string>
  • getDefaultRedirectionURL(_: GetRedirectionURLContext | T): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>
  • signOut(input?: { userContext?: any }): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property
  • Inherited method

Settings

Theme

Generated using TypeDoc

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

Class default<T, Action, R, N> Abstract

Type Parameters

  • T

  • Action

  • R

  • N extends NormalisedConfig<T | GetRedirectionURLContext, Action, R | OnHandleEventContext>

Hierarchy

  • default<T | GetRedirectionURLContext, Action, R | OnHandleEventContext, N>
    • default

Index

Constructors

  • new default<T, Action, R, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<T, Action, R, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • doesSessionExist(input?: { userContext?: any }): Promise<boolean>
  • getAuthRecipeDefaultRedirectionURL(context: GetRedirectionURLContext): Promise<string>
  • getDefaultRedirectionURL(_: GetRedirectionURLContext | T): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>
  • signOut(input?: { userContext?: any }): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property
  • Inherited method

Settings

Theme

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 bc5ed5c1d..3f896ef44 100644 --- a/docs/classes/recipe_emailpassword.default.html +++ b/docs/classes/recipe_emailpassword.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

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

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

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

  • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

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

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

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

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

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

  • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

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

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

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 d0a889f56..7d15f52cf 100644 --- a/docs/classes/recipe_emailverification.default.html +++ b/docs/classes/recipe_emailverification.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider
EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationRecipe.EmailVerificationClaim

Methods

  • getEmailVerificationTokenFromURL(input?: { userContext?: any }): string
  • isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>
  • Parameters

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

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

  • sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • Parameters

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

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

  • verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
  • Parameters

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider
EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationRecipe.EmailVerificationClaim

Methods

  • getEmailVerificationTokenFromURL(input?: { userContext?: any }): string
  • isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>
  • Parameters

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

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

  • sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • Parameters

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

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

  • verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
  • Parameters

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_multitenancy.default.html b/docs/classes/recipe_multitenancy.default.html index 1f4e1b36a..336b04b4b 100644 --- a/docs/classes/recipe_multitenancy.default.html +++ b/docs/classes/recipe_multitenancy.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

AllowedDomainsClaim: AllowedDomainsClaimClass = AllowedDomainsClaim
ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

AllowedDomainsClaim: AllowedDomainsClaimClass = AllowedDomainsClaim
ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_passwordless.default.html b/docs/classes/recipe_passwordless.default.html index bb59a6ae4..357a1df29 100644 --- a/docs/classes/recipe_passwordless.default.html +++ b/docs/classes/recipe_passwordless.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

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

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

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

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

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

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

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

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

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

    • CustomLoginAttemptInfoProperties

    Parameters

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

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

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

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

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

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

    • CustomStateProperties

    Parameters

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

    Returns Promise<void>

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

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

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

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

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

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

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

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

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

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

    • CustomLoginAttemptInfoProperties

    Parameters

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

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

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

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

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

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

    • CustomStateProperties

    Parameters

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

    Returns Promise<void>

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_recipeModule.default.html b/docs/classes/recipe_recipeModule.default.html index 7169a6533..b3fed7478 100644 --- a/docs/classes/recipe_recipeModule.default.html +++ b/docs/classes/recipe_recipeModule.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N> Abstract

Type Parameters

  • GetRedirectionURLContextType

  • Action

  • OnHandleEventContextType

  • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

Hierarchy

  • BaseRecipeModule<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Index

Constructors

  • new default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>
  • Type Parameters

    • GetRedirectionURLContextType

    • Action

    • OnHandleEventContextType

    • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

    Parameters

    • config: NormalisedConfigWithAppInfoAndRecipeID<N>

    Returns default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • getDefaultRedirectionURL(_: GetRedirectionURLContextType): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property

Settings

Theme

Generated using TypeDoc

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

Class default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N> Abstract

Type Parameters

  • GetRedirectionURLContextType

  • Action

  • OnHandleEventContextType

  • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

Hierarchy

  • BaseRecipeModule<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Index

Constructors

  • new default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>
  • Type Parameters

    • GetRedirectionURLContextType

    • Action

    • OnHandleEventContextType

    • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

    Parameters

    • config: NormalisedConfigWithAppInfoAndRecipeID<N>

    Returns default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • getDefaultRedirectionURL(_: GetRedirectionURLContextType): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_session.BooleanClaim.html b/docs/classes/recipe_session.BooleanClaim.html index 6e71b0462..80d3c2365 100644 --- a/docs/classes/recipe_session.BooleanClaim.html +++ b/docs/classes/recipe_session.BooleanClaim.html @@ -1,3 +1,3 @@ -BooleanClaim | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • BooleanClaim
    • BooleanClaim

Index

Constructors

  • new BooleanClaim(config: PrimitiveClaimConfig & { onFailureRedirection?: ValidationFailureCallback; showAccessDeniedOnFailure?: boolean }): BooleanClaim
  • Parameters

    • config: PrimitiveClaimConfig & { onFailureRedirection?: ValidationFailureCallback; showAccessDeniedOnFailure?: boolean }

    Returns BooleanClaim

Properties

defaultMaxAgeInSeconds: undefined | number
id: string
refresh: ((userContext: any) => Promise<void>)

Type declaration

UserInput: { override?: { functions?: any } } & RecipeModuleUserInput<any, PreAndPostAPIHookAction, any>

Variables

AllowedDomainsClaim: AllowedDomainsClaimClass
MultitenancyComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

Functions

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

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 diff --git a/docs/modules/recipe_passwordless.html b/docs/modules/recipe_passwordless.html index 7ca341c5e..d2f880532 100644 --- a/docs/modules/recipe_passwordless.html +++ b/docs/modules/recipe_passwordless.html @@ -1,4 +1,4 @@ -recipe/passwordless | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

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

Type declaration

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

Type declaration

  • clearLoginAttemptInfo:function
    • clearLoginAttemptInfo(input: { userContext: any }): Promise<void>
    • +recipe/passwordless | supertokens-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Type Aliases

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

      Type declaration

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

      Type declaration

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

          Parameters

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

          Returns Promise<void>

      • consumeCode:function
        • consumeCode(input: { deviceId: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any; userInputCode: string } | { linkCode: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
        • Log the user in using the input code or link code

          @@ -34,4 +34,4 @@

          Parameters

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

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

          {status: "OK"} if succesful

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

          -

          Type Parameters

          • CustomStateProperties

          Parameters

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

          Returns Promise<void>

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

      Variables

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

      Functions

      • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
      • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

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

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

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

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

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

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

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

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

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

        • CustomLoginAttemptInfoProperties

        Parameters

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

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

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

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

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

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

        • CustomStateProperties

        Parameters

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

        Returns Promise<void>

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

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

      Returns Promise<void>

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

Variables

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

Functions

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

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

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

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

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

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

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

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

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

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

    • CustomLoginAttemptInfoProperties

    Parameters

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

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

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

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

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

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

    • CustomStateProperties

    Parameters

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

    Returns Promise<void>

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

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 diff --git a/docs/modules/recipe_session.html b/docs/modules/recipe_session.html index 849b1f4e9..0d4ffb1ea 100644 --- a/docs/modules/recipe_session.html +++ b/docs/modules/recipe_session.html @@ -1,8 +1,8 @@ -recipe/session | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

ClaimValidationError: { reason?: any; validatorId: string }

Type declaration

  • Optional reason?: any
  • validatorId: string
ClaimValidationResult: { isValid: true } | { isValid: false; reason?: any }
InputType: WebJSInputType & { accessDeniedScreen?: SessionFeatureBaseConfig; style?: string; onHandleEvent?: any }
RecipeInterface: { addAxiosInterceptors: any; addFetchInterceptorsAndReturnModifiedFetch: any; addXMLHttpRequestInterceptor: any; doesSessionExist: any; getAccessTokenPayloadSecurely: any; getGlobalClaimValidators: any; getInvalidClaimsFromResponse: any; getUserId: any; shouldDoInterceptionBasedOnUrl: any; signOut: any; validateClaims: any }

Type declaration

  • addAxiosInterceptors:function
    • addAxiosInterceptors(input: { axiosInstance: any; userContext: any }): void
    • Parameters

      • input: { axiosInstance: any; userContext: any }
        • axiosInstance: any
        • userContext: any

      Returns void

  • addFetchInterceptorsAndReturnModifiedFetch:function
    • addFetchInterceptorsAndReturnModifiedFetch(input: { originalFetch: any; userContext: any }): ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)
    • Parameters

      • input: { originalFetch: any; userContext: any }
        • originalFetch: any
        • userContext: any

      Returns ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)

        • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
        • Parameters

          • input: URL | RequestInfo
          • Optional init: RequestInit

          Returns Promise<Response>

  • addXMLHttpRequestInterceptor:function
    • addXMLHttpRequestInterceptor(input: { userContext: any }): void
    • Parameters

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

      Returns void

  • doesSessionExist:function
    • doesSessionExist(input: { userContext: any }): Promise<boolean>
    • Parameters

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

      Returns Promise<boolean>

  • getAccessTokenPayloadSecurely:function
    • getAccessTokenPayloadSecurely(input: { userContext: any }): Promise<any>
    • Parameters

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

      Returns Promise<any>

  • getGlobalClaimValidators:function
  • getInvalidClaimsFromResponse:function
    • getInvalidClaimsFromResponse(input: { response: { data: any } | Response; userContext: any }): Promise<ClaimValidationError[]>
    • Parameters

      • input: { response: { data: any } | Response; userContext: any }
        • response: { data: any } | Response
        • userContext: any

      Returns Promise<ClaimValidationError[]>

  • getUserId:function
    • getUserId(input: { userContext: any }): Promise<string>
    • Parameters

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

      Returns Promise<string>

  • shouldDoInterceptionBasedOnUrl:function
    • shouldDoInterceptionBasedOnUrl(toCheckUrl: string, apiDomain: string, sessionTokenBackendDomain: undefined | string): boolean
    • Parameters

      • toCheckUrl: string
      • apiDomain: string
      • sessionTokenBackendDomain: undefined | string

      Returns boolean

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

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

      Returns Promise<void>

  • validateClaims:function
SessionClaim<ValueType>: { getLastFetchedTime: any; getValueFromPayload: any; refresh: any }

Type Parameters

  • ValueType

Type declaration

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

      • payload: any
      • Optional _userContext: any

      Returns undefined | number

  • getValueFromPayload:function
    • getValueFromPayload(payload: any, _userContext?: any): undefined | ValueType
    • Parameters

      • payload: any
      • Optional _userContext: any

      Returns undefined | ValueType

  • refresh:function
    • refresh(userContext: any): Promise<void>
    • Parameters

      • userContext: any

      Returns Promise<void>

SessionClaimValidator: { id: string; refresh: any; shouldRefresh: any; validate: any }

Type declaration

  • Readonly id: string
  • refresh:function
    • refresh(userContext: any): Promise<void>
    • +recipe/session | supertokens-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Type Aliases

      ClaimValidationError: { reason?: any; validatorId: string }

      Type declaration

      • Optional reason?: any
      • validatorId: string
      ClaimValidationResult: { isValid: true } | { isValid: false; reason?: any }
      InputType: WebJSInputType & { accessDeniedScreen?: SessionFeatureBaseConfig; style?: string; onHandleEvent?: any }
      RecipeInterface: { addAxiosInterceptors: any; addFetchInterceptorsAndReturnModifiedFetch: any; addXMLHttpRequestInterceptor: any; doesSessionExist: any; getAccessTokenPayloadSecurely: any; getGlobalClaimValidators: any; getInvalidClaimsFromResponse: any; getUserId: any; shouldDoInterceptionBasedOnUrl: any; signOut: any; validateClaims: any }

      Type declaration

      • addAxiosInterceptors:function
        • addAxiosInterceptors(input: { axiosInstance: any; userContext: any }): void
        • Parameters

          • input: { axiosInstance: any; userContext: any }
            • axiosInstance: any
            • userContext: any

          Returns void

      • addFetchInterceptorsAndReturnModifiedFetch:function
        • addFetchInterceptorsAndReturnModifiedFetch(input: { originalFetch: any; userContext: any }): ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)
        • Parameters

          • input: { originalFetch: any; userContext: any }
            • originalFetch: any
            • userContext: any

          Returns ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)

            • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
            • Parameters

              • input: URL | RequestInfo
              • Optional init: RequestInit

              Returns Promise<Response>

      • addXMLHttpRequestInterceptor:function
        • addXMLHttpRequestInterceptor(input: { userContext: any }): void
        • Parameters

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

          Returns void

      • doesSessionExist:function
        • doesSessionExist(input: { userContext: any }): Promise<boolean>
        • Parameters

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

          Returns Promise<boolean>

      • getAccessTokenPayloadSecurely:function
        • getAccessTokenPayloadSecurely(input: { userContext: any }): Promise<any>
        • Parameters

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

          Returns Promise<any>

      • getGlobalClaimValidators:function
      • getInvalidClaimsFromResponse:function
        • getInvalidClaimsFromResponse(input: { response: { data: any } | Response; userContext: any }): Promise<ClaimValidationError[]>
        • Parameters

          • input: { response: { data: any } | Response; userContext: any }
            • response: { data: any } | Response
            • userContext: any

          Returns Promise<ClaimValidationError[]>

      • getUserId:function
        • getUserId(input: { userContext: any }): Promise<string>
        • Parameters

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

          Returns Promise<string>

      • shouldDoInterceptionBasedOnUrl:function
        • shouldDoInterceptionBasedOnUrl(toCheckUrl: string, apiDomain: string, sessionTokenBackendDomain: undefined | string): boolean
        • Parameters

          • toCheckUrl: string
          • apiDomain: string
          • sessionTokenBackendDomain: undefined | string

          Returns boolean

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

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

          Returns Promise<void>

      • validateClaims:function
      SessionClaim<ValueType>: { getLastFetchedTime: any; getValueFromPayload: any; refresh: any }

      Type Parameters

      • ValueType

      Type declaration

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

          • payload: any
          • Optional _userContext: any

          Returns undefined | number

      • getValueFromPayload:function
        • getValueFromPayload(payload: any, _userContext?: any): undefined | ValueType
        • Parameters

          • payload: any
          • Optional _userContext: any

          Returns undefined | ValueType

      • refresh:function
        • refresh(userContext: any): Promise<void>
        • Parameters

          • userContext: any

          Returns Promise<void>

      SessionClaimValidator: { id: string; refresh: any; shouldRefresh: any; validate: any }

      Type declaration

      • Readonly id: string
      • refresh:function
        • refresh(userContext: any): Promise<void>
        • Makes an API call that will refresh the claim in the token.

          Parameters

          • userContext: any

          Returns Promise<void>

      • shouldRefresh:function
        • shouldRefresh(accessTokenPayload: any, userContext: any): boolean | Promise<boolean>
        • Decides if we need to refresh the claim value before checking the payload with validate. E.g.: if the information in the payload is expired, or is not sufficient for this validator.

          Parameters

          • accessTokenPayload: any
          • userContext: any

          Returns boolean | Promise<boolean>

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

      SessionContextType: LoadedSessionContext | { loading: true }

      Variables

      SessionAuth: FC<PropsWithChildren<SessionAuthProps & { userContext?: any }>> = SessionAPIWrapper.SessionAuth
      SessionComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = SessionAPIWrapper.ComponentsOverrideProvider
      SessionContext: Context<{ accessDeniedValidatorError?: ClaimValidationError; invalidClaims: ClaimValidationError[]; loading: false } & SessionContextUpdate & { isDefault?: boolean } & { loading: true } & { isDefault?: boolean }> = ...

      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?: InputType): RecipeInitResult<unknown, unknown, unknown, any>
      • signOut(input?: { userContext?: any }): Promise<void>
      • useClaimValue<T>(claim: SessionClaim<T>): { loading: true } | { doesSessionExist: boolean; loading: false; value: undefined | T }

      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 +

      Parameters

      • accessTokenPayload: any
      • userContext: any

      Returns ClaimValidationResult | Promise<ClaimValidationResult>

SessionContextType: LoadedSessionContext | { loading: true }

Variables

SessionAuth: FC<PropsWithChildren<SessionAuthProps & { userContext?: any }>> = SessionAPIWrapper.SessionAuth
SessionComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = SessionAPIWrapper.ComponentsOverrideProvider
SessionContext: Context<{ accessDeniedValidatorError?: ClaimValidationError; invalidClaims: ClaimValidationError[]; loading: false } & SessionContextUpdate & { isDefault?: boolean } & { loading: true } & { isDefault?: boolean }> = ...

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?: InputType): RecipeInitResult<unknown, unknown, unknown, any>
  • signOut(input?: { userContext?: any }): Promise<void>
  • useClaimValue<T>(claim: SessionClaim<T>): { loading: true } | { doesSessionExist: boolean; loading: false; value: undefined | T }

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 diff --git a/docs/modules/recipe_thirdparty.html b/docs/modules/recipe_thirdparty.html index fce5e7e9e..e7a148db5 100644 --- a/docs/modules/recipe_thirdparty.html +++ b/docs/modules/recipe_thirdparty.html @@ -1,4 +1,4 @@ -recipe/thirdparty | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

GetRedirectionURLContext: AuthRecipeModuleGetRedirectionURLContext
OnHandleEventContext: AuthRecipeModuleOnHandleEventContext | { action: "SUCCESS"; isNewRecipeUser: boolean; user: User; userContext: any }
PreAPIHookContext: { action: PreAndPostAPIHookAction; requestInit: RequestInit; url: string; userContext: any }

Type declaration

  • action: PreAndPostAPIHookAction
  • requestInit: RequestInit
  • url: string
  • userContext: any
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-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Type Aliases

      GetRedirectionURLContext: AuthRecipeModuleGetRedirectionURLContext
      OnHandleEventContext: AuthRecipeModuleOnHandleEventContext | { action: "SUCCESS"; isNewRecipeUser: boolean; user: User; userContext: any }
      PreAPIHookContext: { action: PreAndPostAPIHookAction; requestInit: RequestInit; url: string; userContext: any }

      Type declaration

      • action: PreAndPostAPIHookAction
      • requestInit: RequestInit
      • url: string
      • userContext: any
      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
        • @@ -26,4 +26,4 @@

          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

      • 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: { oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

      Variables

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

      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
      • Type Parameters

        • CustomStateProperties

        Parameters

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

        Returns undefined | StateObject & CustomStateProperties

      • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
      • Parameters

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

        Returns Promise<{ status: "OK" | "ERROR" }>

      • 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

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

        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>

UserInput: { oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

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

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
  • Type Parameters

    • CustomStateProperties

    Parameters

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

    Returns undefined | StateObject & CustomStateProperties

  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
  • Parameters

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

    Returns Promise<{ status: "OK" | "ERROR" }>

  • 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

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

    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 diff --git a/docs/modules/recipe_thirdpartyemailpassword.html b/docs/modules/recipe_thirdpartyemailpassword.html index 88b3646a4..166ef705d 100644 --- a/docs/modules/recipe_thirdpartyemailpassword.html +++ b/docs/modules/recipe_thirdpartyemailpassword.html @@ -1,4 +1,4 @@ -recipe/thirdpartyemailpassword | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/thirdpartyemailpassword

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: { 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-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Module recipe/thirdpartyemailpassword

      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: { 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" }>
        • Check if an 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}

          @@ -51,4 +51,4 @@

          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

      • 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: { disableEmailPassword?: boolean; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; resetPasswordUsingTokenFeature?: ResetPasswordUsingTokenUserInput; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

      Variables

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

      Functions

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

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

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

      • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
      • getStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
      • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
      • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "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" }>
      • Parameters

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

        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: { disableEmailPassword?: boolean; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; resetPasswordUsingTokenFeature?: ResetPasswordUsingTokenUserInput; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

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

Functions

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

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

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

  • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
  • getStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "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" }>
  • Parameters

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

    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 diff --git a/docs/modules/recipe_thirdpartypasswordless.html b/docs/modules/recipe_thirdpartypasswordless.html index 56051da9c..57647c3d4 100644 --- a/docs/modules/recipe_thirdpartypasswordless.html +++ b/docs/modules/recipe_thirdpartypasswordless.html @@ -1,4 +1,4 @@ -recipe/thirdpartypasswordless | supertokens-auth-react
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>
    • +recipe/thirdpartypasswordless | supertokens-auth-react
      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

          @@ -62,4 +62,4 @@

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

      Variables

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

      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

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

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

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

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

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

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

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

        Returns 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 } & CustomLoginAttemptInfoProperties>
      • Type Parameters

        • CustomLoginAttemptInfoProperties

        Parameters

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

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

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

      • getThirdPartyStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
      • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
      • resendPasswordlessCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
      • Parameters

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

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

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

        • CustomStateProperties

        Parameters

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

        Returns Promise<void>

      • signOut(input?: { userContext?: any }): Promise<void>
      • thirdPartySignInAndUp(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

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

        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: ({ 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; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any } } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

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

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

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

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

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

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

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

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

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

    Returns 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 } & CustomLoginAttemptInfoProperties>
  • Type Parameters

    • CustomLoginAttemptInfoProperties

    Parameters

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

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

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

  • getThirdPartyStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
  • resendPasswordlessCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
  • Parameters

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

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

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

    • CustomStateProperties

    Parameters

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

    Returns Promise<void>

  • signOut(input?: { userContext?: any }): Promise<void>
  • thirdPartySignInAndUp(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

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

    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 From 4ac34fda1b0300cdd2ea5b7c56860b76196984e9 Mon Sep 17 00:00:00 2001 From: Amit Badala Date: Sun, 26 Nov 2023 12:22:24 +0530 Subject: [PATCH 07/12] Event handler props on input component should be non-optional (#768) * Event handler props on input component should be non-optional * version and changelog change --------- Co-authored-by: rishabhpoddar --- CHANGELOG.md | 6 +++++- .../emailpassword/components/library/input.d.ts | 6 +++--- lib/build/version.d.ts | 2 +- .../emailpassword/components/library/input.tsx | 6 +++--- lib/ts/version.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- test/with-typescript/src/App.tsx | 16 ++++------------ 8 files changed, 20 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c84f6e6e..2e2748aad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) -## [0.35.7] - 2023-11-16 +## [0.35.8] - 2023-11-26 + +- Fixes `inputComponent` props to make them non optional. This is in the context of customizing the sign up form to add custom react components. + +## [0.35.7] - 2023-11-24 ### Added diff --git a/lib/build/recipe/emailpassword/components/library/input.d.ts b/lib/build/recipe/emailpassword/components/library/input.d.ts index 973042e7c..beb678655 100644 --- a/lib/build/recipe/emailpassword/components/library/input.d.ts +++ b/lib/build/recipe/emailpassword/components/library/input.d.ts @@ -8,9 +8,9 @@ export declare type InputProps = { hasError: boolean; placeholder: string; value: string; - onInputBlur?: (value: string) => void; - onInputFocus?: (value: string) => void; - onChange?: (value: string) => void; + onInputBlur: (value: string) => void; + onInputFocus: (value: string) => void; + onChange: (value: string) => void; }; declare const Input: React.FC; export default Input; diff --git a/lib/build/version.d.ts b/lib/build/version.d.ts index 61197a780..cfe379a1e 100644 --- a/lib/build/version.d.ts +++ b/lib/build/version.d.ts @@ -1 +1 @@ -export declare const package_version = "0.35.7"; +export declare const package_version = "0.35.8"; diff --git a/lib/ts/recipe/emailpassword/components/library/input.tsx b/lib/ts/recipe/emailpassword/components/library/input.tsx index 0f1877e1b..ed0941542 100644 --- a/lib/ts/recipe/emailpassword/components/library/input.tsx +++ b/lib/ts/recipe/emailpassword/components/library/input.tsx @@ -31,9 +31,9 @@ export type InputProps = { hasError: boolean; placeholder: string; value: string; - onInputBlur?: (value: string) => void; - onInputFocus?: (value: string) => void; - onChange?: (value: string) => void; + onInputBlur: (value: string) => void; + onInputFocus: (value: string) => void; + onChange: (value: string) => void; }; const Input: React.FC = ({ diff --git a/lib/ts/version.ts b/lib/ts/version.ts index 8d697de72..a6d28e815 100644 --- a/lib/ts/version.ts +++ b/lib/ts/version.ts @@ -12,4 +12,4 @@ * License for the specific language governing permissions and limitations * under the License. */ -export const package_version = "0.35.7"; +export const package_version = "0.35.8"; diff --git a/package-lock.json b/package-lock.json index f2efb65d3..c16a56d1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "supertokens-auth-react", - "version": "0.35.7", + "version": "0.35.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "supertokens-auth-react", - "version": "0.35.7", + "version": "0.35.8", "license": "Apache-2.0", "dependencies": { "intl-tel-input": "^17.0.19", diff --git a/package.json b/package.json index eedec85f3..cb820d2cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "supertokens-auth-react", - "version": "0.35.7", + "version": "0.35.8", "description": "ReactJS SDK that provides login functionality with SuperTokens.", "main": "./index.js", "engines": { diff --git a/test/with-typescript/src/App.tsx b/test/with-typescript/src/App.tsx index 25ee1151f..167a3a565 100644 --- a/test/with-typescript/src/App.tsx +++ b/test/with-typescript/src/App.tsx @@ -400,9 +400,7 @@ function getEmailPasswordConfigs() { value={inputProps.value} checked={inputProps.value === "true"} onChange={(e) => { - if (inputProps.onChange) { - inputProps.onChange(e.target.checked.toString()); - } + inputProps.onChange(e.target.checked.toString()); }}> I agree to the terms and conditions @@ -421,21 +419,15 @@ function getEmailPasswordConfigs() { inputComponent: (inputProps) => (
  • Preparing search index...
  • The search index is not available
supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

SuperTokensWrapper: FC<PropsWithChildren<{ userContext?: any }>> = SuperTokensWrapper
useTranslation: (() => TranslationFunc) = useTranslation

Type declaration

    • (): TranslationFunc
    • Returns TranslationFunc

useUserContext: (() => any) = useUserContext

Type declaration

    • (): any
    • Returns any

Methods

  • changeLanguage(language: string): Promise<void>
  • init(config: SuperTokensConfig): void
  • loadTranslation(store: TranslationStore): void
  • redirectToAuth(options?: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }): Promise<void>
  • Parameters

    • Optional options: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }
      • Optional history?: any
      • Optional queryParams?: any
      • Optional redirectBack?: boolean
      • Optional show?: "signin" | "signup"

    Returns Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

SuperTokensWrapper: FC<PropsWithChildren<{ userContext?: any }>> = SuperTokensWrapper
useTranslation: (() => TranslationFunc) = useTranslation

Type declaration

    • (): TranslationFunc
    • Returns TranslationFunc

useUserContext: (() => any) = useUserContext

Type declaration

    • (): any
    • Returns any

Methods

  • changeLanguage(language: string): Promise<void>
  • init(config: SuperTokensConfig): void
  • loadTranslation(store: TranslationStore): void
  • redirectToAuth(options?: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }): Promise<void>
  • Parameters

    • Optional options: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }
      • Optional history?: any
      • Optional queryParams?: any
      • Optional redirectBack?: boolean
      • Optional show?: "signin" | "signup"

    Returns Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

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 fe58ea1f5..a5eaa67a7 100644 --- a/docs/classes/recipe_authRecipe.default.html +++ b/docs/classes/recipe_authRecipe.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<T, Action, R, N> Abstract

Type Parameters

  • T

  • Action

  • R

  • N extends NormalisedConfig<T | GetRedirectionURLContext, Action, R | OnHandleEventContext>

Hierarchy

  • default<T | GetRedirectionURLContext, Action, R | OnHandleEventContext, N>
    • default

Index

Constructors

  • new default<T, Action, R, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<T, Action, R, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • doesSessionExist(input?: { userContext?: any }): Promise<boolean>
  • getAuthRecipeDefaultRedirectionURL(context: GetRedirectionURLContext): Promise<string>
  • getDefaultRedirectionURL(_: GetRedirectionURLContext | T): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>
  • signOut(input?: { userContext?: any }): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property
  • Inherited method

Settings

Theme

Generated using TypeDoc

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

Class default<T, Action, R, N> Abstract

Type Parameters

  • T

  • Action

  • R

  • N extends NormalisedConfig<T | GetRedirectionURLContext, Action, R | OnHandleEventContext>

Hierarchy

  • default<T | GetRedirectionURLContext, Action, R | OnHandleEventContext, N>
    • default

Index

Constructors

  • new default<T, Action, R, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<T, Action, R, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • doesSessionExist(input?: { userContext?: any }): Promise<boolean>
  • getAuthRecipeDefaultRedirectionURL(context: GetRedirectionURLContext): Promise<string>
  • getDefaultRedirectionURL(_: GetRedirectionURLContext | T): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>
  • signOut(input?: { userContext?: any }): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property
  • Inherited method

Settings

Theme

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 3f896ef44..17dd7e299 100644 --- a/docs/classes/recipe_emailpassword.default.html +++ b/docs/classes/recipe_emailpassword.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

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

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

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

  • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

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

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

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

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

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

  • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

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

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

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 7d15f52cf..991df5e80 100644 --- a/docs/classes/recipe_emailverification.default.html +++ b/docs/classes/recipe_emailverification.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider
EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationRecipe.EmailVerificationClaim

Methods

  • getEmailVerificationTokenFromURL(input?: { userContext?: any }): string
  • isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>
  • Parameters

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

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

  • sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • Parameters

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

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

  • verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
  • Parameters

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider
EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationRecipe.EmailVerificationClaim

Methods

  • getEmailVerificationTokenFromURL(input?: { userContext?: any }): string
  • isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>
  • Parameters

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

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

  • sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • Parameters

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

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

  • verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
  • Parameters

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_multitenancy.default.html b/docs/classes/recipe_multitenancy.default.html index 336b04b4b..28d2491b3 100644 --- a/docs/classes/recipe_multitenancy.default.html +++ b/docs/classes/recipe_multitenancy.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

AllowedDomainsClaim: AllowedDomainsClaimClass = AllowedDomainsClaim
ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

AllowedDomainsClaim: AllowedDomainsClaimClass = AllowedDomainsClaim
ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_passwordless.default.html b/docs/classes/recipe_passwordless.default.html index 357a1df29..f9d1679cc 100644 --- a/docs/classes/recipe_passwordless.default.html +++ b/docs/classes/recipe_passwordless.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

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

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

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

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

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

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

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

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

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

    • CustomLoginAttemptInfoProperties

    Parameters

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

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

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

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

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

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

    • CustomStateProperties

    Parameters

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

    Returns Promise<void>

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

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

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

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

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

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

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

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

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

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

    • CustomLoginAttemptInfoProperties

    Parameters

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

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

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

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

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

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

    • CustomStateProperties

    Parameters

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

    Returns Promise<void>

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_recipeModule.default.html b/docs/classes/recipe_recipeModule.default.html index b3fed7478..f05cb1ccd 100644 --- a/docs/classes/recipe_recipeModule.default.html +++ b/docs/classes/recipe_recipeModule.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N> Abstract

Type Parameters

  • GetRedirectionURLContextType

  • Action

  • OnHandleEventContextType

  • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

Hierarchy

  • BaseRecipeModule<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Index

Constructors

  • new default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>
  • Type Parameters

    • GetRedirectionURLContextType

    • Action

    • OnHandleEventContextType

    • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

    Parameters

    • config: NormalisedConfigWithAppInfoAndRecipeID<N>

    Returns default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • getDefaultRedirectionURL(_: GetRedirectionURLContextType): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property

Settings

Theme

Generated using TypeDoc

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

Class default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N> Abstract

Type Parameters

  • GetRedirectionURLContextType

  • Action

  • OnHandleEventContextType

  • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

Hierarchy

  • BaseRecipeModule<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Index

Constructors

  • new default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>
  • Type Parameters

    • GetRedirectionURLContextType

    • Action

    • OnHandleEventContextType

    • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

    Parameters

    • config: NormalisedConfigWithAppInfoAndRecipeID<N>

    Returns default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • getDefaultRedirectionURL(_: GetRedirectionURLContextType): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_session.BooleanClaim.html b/docs/classes/recipe_session.BooleanClaim.html index 80d3c2365..645ade2df 100644 --- a/docs/classes/recipe_session.BooleanClaim.html +++ b/docs/classes/recipe_session.BooleanClaim.html @@ -1,3 +1,3 @@ -BooleanClaim | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • BooleanClaim
    • BooleanClaim

Index

Constructors

  • new BooleanClaim(config: PrimitiveClaimConfig & { onFailureRedirection?: ValidationFailureCallback; showAccessDeniedOnFailure?: boolean }): BooleanClaim
  • Parameters

    • config: PrimitiveClaimConfig & { onFailureRedirection?: ValidationFailureCallback; showAccessDeniedOnFailure?: boolean }

    Returns BooleanClaim

Properties

defaultMaxAgeInSeconds: undefined | number
id: string
refresh: ((userContext: any) => Promise<void>)

Type declaration

UserInput: { override?: { functions?: any } } & RecipeModuleUserInput<any, PreAndPostAPIHookAction, any>

Variables

AllowedDomainsClaim: AllowedDomainsClaimClass
MultitenancyComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

Functions

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

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 diff --git a/docs/modules/recipe_passwordless.html b/docs/modules/recipe_passwordless.html index d2f880532..9752c3cd6 100644 --- a/docs/modules/recipe_passwordless.html +++ b/docs/modules/recipe_passwordless.html @@ -1,4 +1,4 @@ -recipe/passwordless | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

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

Type declaration

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

Type declaration

  • clearLoginAttemptInfo:function
    • clearLoginAttemptInfo(input: { userContext: any }): Promise<void>
    • +recipe/passwordless | supertokens-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Type Aliases

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

      Type declaration

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

      Type declaration

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

          Parameters

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

          Returns Promise<void>

      • consumeCode:function
        • consumeCode(input: { deviceId: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any; userInputCode: string } | { linkCode: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
        • Log the user in using the input code or link code

          @@ -34,4 +34,4 @@

          Parameters

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

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

          {status: "OK"} if succesful

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

          -

          Type Parameters

          • CustomStateProperties

          Parameters

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

          Returns Promise<void>

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

      Variables

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

      Functions

      • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
      • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

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

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

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

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

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

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

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

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

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

        • CustomLoginAttemptInfoProperties

        Parameters

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

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

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

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

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

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

        • CustomStateProperties

        Parameters

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

        Returns Promise<void>

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

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

      Returns Promise<void>

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

Variables

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

Functions

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

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

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

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

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

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

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

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

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

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

    • CustomLoginAttemptInfoProperties

    Parameters

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

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

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

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

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

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

    • CustomStateProperties

    Parameters

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

    Returns Promise<void>

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

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 diff --git a/docs/modules/recipe_session.html b/docs/modules/recipe_session.html index 0d4ffb1ea..bf384b754 100644 --- a/docs/modules/recipe_session.html +++ b/docs/modules/recipe_session.html @@ -1,8 +1,8 @@ -recipe/session | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

ClaimValidationError: { reason?: any; validatorId: string }

Type declaration

  • Optional reason?: any
  • validatorId: string
ClaimValidationResult: { isValid: true } | { isValid: false; reason?: any }
InputType: WebJSInputType & { accessDeniedScreen?: SessionFeatureBaseConfig; style?: string; onHandleEvent?: any }
RecipeInterface: { addAxiosInterceptors: any; addFetchInterceptorsAndReturnModifiedFetch: any; addXMLHttpRequestInterceptor: any; doesSessionExist: any; getAccessTokenPayloadSecurely: any; getGlobalClaimValidators: any; getInvalidClaimsFromResponse: any; getUserId: any; shouldDoInterceptionBasedOnUrl: any; signOut: any; validateClaims: any }

Type declaration

  • addAxiosInterceptors:function
    • addAxiosInterceptors(input: { axiosInstance: any; userContext: any }): void
    • Parameters

      • input: { axiosInstance: any; userContext: any }
        • axiosInstance: any
        • userContext: any

      Returns void

  • addFetchInterceptorsAndReturnModifiedFetch:function
    • addFetchInterceptorsAndReturnModifiedFetch(input: { originalFetch: any; userContext: any }): ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)
    • Parameters

      • input: { originalFetch: any; userContext: any }
        • originalFetch: any
        • userContext: any

      Returns ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)

        • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
        • Parameters

          • input: URL | RequestInfo
          • Optional init: RequestInit

          Returns Promise<Response>

  • addXMLHttpRequestInterceptor:function
    • addXMLHttpRequestInterceptor(input: { userContext: any }): void
    • Parameters

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

      Returns void

  • doesSessionExist:function
    • doesSessionExist(input: { userContext: any }): Promise<boolean>
    • Parameters

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

      Returns Promise<boolean>

  • getAccessTokenPayloadSecurely:function
    • getAccessTokenPayloadSecurely(input: { userContext: any }): Promise<any>
    • Parameters

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

      Returns Promise<any>

  • getGlobalClaimValidators:function
  • getInvalidClaimsFromResponse:function
    • getInvalidClaimsFromResponse(input: { response: { data: any } | Response; userContext: any }): Promise<ClaimValidationError[]>
    • Parameters

      • input: { response: { data: any } | Response; userContext: any }
        • response: { data: any } | Response
        • userContext: any

      Returns Promise<ClaimValidationError[]>

  • getUserId:function
    • getUserId(input: { userContext: any }): Promise<string>
    • Parameters

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

      Returns Promise<string>

  • shouldDoInterceptionBasedOnUrl:function
    • shouldDoInterceptionBasedOnUrl(toCheckUrl: string, apiDomain: string, sessionTokenBackendDomain: undefined | string): boolean
    • Parameters

      • toCheckUrl: string
      • apiDomain: string
      • sessionTokenBackendDomain: undefined | string

      Returns boolean

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

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

      Returns Promise<void>

  • validateClaims:function
SessionClaim<ValueType>: { getLastFetchedTime: any; getValueFromPayload: any; refresh: any }

Type Parameters

  • ValueType

Type declaration

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

      • payload: any
      • Optional _userContext: any

      Returns undefined | number

  • getValueFromPayload:function
    • getValueFromPayload(payload: any, _userContext?: any): undefined | ValueType
    • Parameters

      • payload: any
      • Optional _userContext: any

      Returns undefined | ValueType

  • refresh:function
    • refresh(userContext: any): Promise<void>
    • Parameters

      • userContext: any

      Returns Promise<void>

SessionClaimValidator: { id: string; refresh: any; shouldRefresh: any; validate: any }

Type declaration

  • Readonly id: string
  • refresh:function
    • refresh(userContext: any): Promise<void>
    • +recipe/session | supertokens-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Type Aliases

      ClaimValidationError: { reason?: any; validatorId: string }

      Type declaration

      • Optional reason?: any
      • validatorId: string
      ClaimValidationResult: { isValid: true } | { isValid: false; reason?: any }
      InputType: WebJSInputType & { accessDeniedScreen?: SessionFeatureBaseConfig; style?: string; onHandleEvent?: any }
      RecipeInterface: { addAxiosInterceptors: any; addFetchInterceptorsAndReturnModifiedFetch: any; addXMLHttpRequestInterceptor: any; doesSessionExist: any; getAccessTokenPayloadSecurely: any; getGlobalClaimValidators: any; getInvalidClaimsFromResponse: any; getUserId: any; shouldDoInterceptionBasedOnUrl: any; signOut: any; validateClaims: any }

      Type declaration

      • addAxiosInterceptors:function
        • addAxiosInterceptors(input: { axiosInstance: any; userContext: any }): void
        • Parameters

          • input: { axiosInstance: any; userContext: any }
            • axiosInstance: any
            • userContext: any

          Returns void

      • addFetchInterceptorsAndReturnModifiedFetch:function
        • addFetchInterceptorsAndReturnModifiedFetch(input: { originalFetch: any; userContext: any }): ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)
        • Parameters

          • input: { originalFetch: any; userContext: any }
            • originalFetch: any
            • userContext: any

          Returns ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)

            • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
            • Parameters

              • input: URL | RequestInfo
              • Optional init: RequestInit

              Returns Promise<Response>

      • addXMLHttpRequestInterceptor:function
        • addXMLHttpRequestInterceptor(input: { userContext: any }): void
        • Parameters

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

          Returns void

      • doesSessionExist:function
        • doesSessionExist(input: { userContext: any }): Promise<boolean>
        • Parameters

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

          Returns Promise<boolean>

      • getAccessTokenPayloadSecurely:function
        • getAccessTokenPayloadSecurely(input: { userContext: any }): Promise<any>
        • Parameters

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

          Returns Promise<any>

      • getGlobalClaimValidators:function
      • getInvalidClaimsFromResponse:function
        • getInvalidClaimsFromResponse(input: { response: { data: any } | Response; userContext: any }): Promise<ClaimValidationError[]>
        • Parameters

          • input: { response: { data: any } | Response; userContext: any }
            • response: { data: any } | Response
            • userContext: any

          Returns Promise<ClaimValidationError[]>

      • getUserId:function
        • getUserId(input: { userContext: any }): Promise<string>
        • Parameters

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

          Returns Promise<string>

      • shouldDoInterceptionBasedOnUrl:function
        • shouldDoInterceptionBasedOnUrl(toCheckUrl: string, apiDomain: string, sessionTokenBackendDomain: undefined | string): boolean
        • Parameters

          • toCheckUrl: string
          • apiDomain: string
          • sessionTokenBackendDomain: undefined | string

          Returns boolean

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

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

          Returns Promise<void>

      • validateClaims:function
      SessionClaim<ValueType>: { getLastFetchedTime: any; getValueFromPayload: any; refresh: any }

      Type Parameters

      • ValueType

      Type declaration

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

          • payload: any
          • Optional _userContext: any

          Returns undefined | number

      • getValueFromPayload:function
        • getValueFromPayload(payload: any, _userContext?: any): undefined | ValueType
        • Parameters

          • payload: any
          • Optional _userContext: any

          Returns undefined | ValueType

      • refresh:function
        • refresh(userContext: any): Promise<void>
        • Parameters

          • userContext: any

          Returns Promise<void>

      SessionClaimValidator: { id: string; refresh: any; shouldRefresh: any; validate: any }

      Type declaration

      • Readonly id: string
      • refresh:function
        • refresh(userContext: any): Promise<void>
        • Makes an API call that will refresh the claim in the token.

          Parameters

          • userContext: any

          Returns Promise<void>

      • shouldRefresh:function
        • shouldRefresh(accessTokenPayload: any, userContext: any): boolean | Promise<boolean>
        • Decides if we need to refresh the claim value before checking the payload with validate. E.g.: if the information in the payload is expired, or is not sufficient for this validator.

          Parameters

          • accessTokenPayload: any
          • userContext: any

          Returns boolean | Promise<boolean>

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

      SessionContextType: LoadedSessionContext | { loading: true }

      Variables

      SessionAuth: FC<PropsWithChildren<SessionAuthProps & { userContext?: any }>> = SessionAPIWrapper.SessionAuth
      SessionComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = SessionAPIWrapper.ComponentsOverrideProvider
      SessionContext: Context<{ accessDeniedValidatorError?: ClaimValidationError; invalidClaims: ClaimValidationError[]; loading: false } & SessionContextUpdate & { isDefault?: boolean } & { loading: true } & { isDefault?: boolean }> = ...

      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?: InputType): RecipeInitResult<unknown, unknown, unknown, any>
      • signOut(input?: { userContext?: any }): Promise<void>
      • useClaimValue<T>(claim: SessionClaim<T>): { loading: true } | { doesSessionExist: boolean; loading: false; value: undefined | T }

      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 +

      Parameters

      • accessTokenPayload: any
      • userContext: any

      Returns ClaimValidationResult | Promise<ClaimValidationResult>

SessionContextType: LoadedSessionContext | { loading: true }

Variables

SessionAuth: FC<PropsWithChildren<SessionAuthProps & { userContext?: any }>> = SessionAPIWrapper.SessionAuth
SessionComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = SessionAPIWrapper.ComponentsOverrideProvider
SessionContext: Context<{ accessDeniedValidatorError?: ClaimValidationError; invalidClaims: ClaimValidationError[]; loading: false } & SessionContextUpdate & { isDefault?: boolean } & { loading: true } & { isDefault?: boolean }> = ...

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?: InputType): RecipeInitResult<unknown, unknown, unknown, any>
  • signOut(input?: { userContext?: any }): Promise<void>
  • useClaimValue<T>(claim: SessionClaim<T>): { loading: true } | { doesSessionExist: boolean; loading: false; value: undefined | T }

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 diff --git a/docs/modules/recipe_thirdparty.html b/docs/modules/recipe_thirdparty.html index e7a148db5..35aea0c46 100644 --- a/docs/modules/recipe_thirdparty.html +++ b/docs/modules/recipe_thirdparty.html @@ -1,4 +1,4 @@ -recipe/thirdparty | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

GetRedirectionURLContext: AuthRecipeModuleGetRedirectionURLContext
OnHandleEventContext: AuthRecipeModuleOnHandleEventContext | { action: "SUCCESS"; isNewRecipeUser: boolean; user: User; userContext: any }
PreAPIHookContext: { action: PreAndPostAPIHookAction; requestInit: RequestInit; url: string; userContext: any }

Type declaration

  • action: PreAndPostAPIHookAction
  • requestInit: RequestInit
  • url: string
  • userContext: any
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-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Type Aliases

      GetRedirectionURLContext: AuthRecipeModuleGetRedirectionURLContext
      OnHandleEventContext: AuthRecipeModuleOnHandleEventContext | { action: "SUCCESS"; isNewRecipeUser: boolean; user: User; userContext: any }
      PreAPIHookContext: { action: PreAndPostAPIHookAction; requestInit: RequestInit; url: string; userContext: any }

      Type declaration

      • action: PreAndPostAPIHookAction
      • requestInit: RequestInit
      • url: string
      • userContext: any
      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
        • @@ -26,4 +26,4 @@

          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

      • 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: { oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

      Variables

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

      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
      • Type Parameters

        • CustomStateProperties

        Parameters

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

        Returns undefined | StateObject & CustomStateProperties

      • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
      • Parameters

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

        Returns Promise<{ status: "OK" | "ERROR" }>

      • 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

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

        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>

UserInput: { oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

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

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
  • Type Parameters

    • CustomStateProperties

    Parameters

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

    Returns undefined | StateObject & CustomStateProperties

  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
  • Parameters

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

    Returns Promise<{ status: "OK" | "ERROR" }>

  • 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

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

    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 diff --git a/docs/modules/recipe_thirdpartyemailpassword.html b/docs/modules/recipe_thirdpartyemailpassword.html index 166ef705d..deb0a018d 100644 --- a/docs/modules/recipe_thirdpartyemailpassword.html +++ b/docs/modules/recipe_thirdpartyemailpassword.html @@ -1,4 +1,4 @@ -recipe/thirdpartyemailpassword | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/thirdpartyemailpassword

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: { 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-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Module recipe/thirdpartyemailpassword

      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: { 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" }>
        • Check if an 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}

          @@ -51,4 +51,4 @@

          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

      • 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: { disableEmailPassword?: boolean; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; resetPasswordUsingTokenFeature?: ResetPasswordUsingTokenUserInput; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

      Variables

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

      Functions

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

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

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

      • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
      • getStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
      • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
      • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "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" }>
      • Parameters

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

        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: { disableEmailPassword?: boolean; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; resetPasswordUsingTokenFeature?: ResetPasswordUsingTokenUserInput; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

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

Functions

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

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

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

  • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
  • getStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "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" }>
  • Parameters

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

    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 diff --git a/docs/modules/recipe_thirdpartypasswordless.html b/docs/modules/recipe_thirdpartypasswordless.html index 57647c3d4..212e88363 100644 --- a/docs/modules/recipe_thirdpartypasswordless.html +++ b/docs/modules/recipe_thirdpartypasswordless.html @@ -1,4 +1,4 @@ -recipe/thirdpartypasswordless | supertokens-auth-react
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>
    • +recipe/thirdpartypasswordless | supertokens-auth-react
      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

          @@ -62,4 +62,4 @@

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

      Variables

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

      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

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

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

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

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

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

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

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

        Returns 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 } & CustomLoginAttemptInfoProperties>
      • Type Parameters

        • CustomLoginAttemptInfoProperties

        Parameters

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

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

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

      • getThirdPartyStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
      • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
      • resendPasswordlessCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
      • Parameters

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

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

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

        • CustomStateProperties

        Parameters

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

        Returns Promise<void>

      • signOut(input?: { userContext?: any }): Promise<void>
      • thirdPartySignInAndUp(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

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

        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: ({ 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; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any } } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

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

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

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

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

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

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

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

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

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

    Returns 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 } & CustomLoginAttemptInfoProperties>
  • Type Parameters

    • CustomLoginAttemptInfoProperties

    Parameters

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

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

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

  • getThirdPartyStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
  • resendPasswordlessCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
  • Parameters

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

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

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

    • CustomStateProperties

    Parameters

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

    Returns Promise<void>

  • signOut(input?: { userContext?: any }): Promise<void>
  • thirdPartySignInAndUp(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

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

    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 From f2862ef84203465a585901d3b26d17b38d3fb083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mih=C3=A1ly=20Lengyel?= Date: Wed, 6 Dec 2023 11:31:03 +0100 Subject: [PATCH 09/12] fix: tpep header with disabled emailpassword (#770) --- CHANGELOG.md | 4 ++++ .../submitNewPassword.d.ts | 2 +- .../components/themes/signInAndUp/signIn.d.ts | 4 ++-- .../components/themes/signInAndUp/signUp.d.ts | 7 +++---- .../components/themes/translations.d.ts | 6 ++++++ .../components/themes/translations.d.ts | 5 +++++ lib/build/thirdparty-shared2.js | 1 + lib/build/thirdpartyemailpasswordprebuiltui.js | 16 ++++++++++------ lib/build/version.d.ts | 2 +- .../components/themes/signInAndUp/index.tsx | 13 +++++++++---- lib/ts/version.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- .../multitenancy.dynamic_login_methods.test.js | 2 ++ 14 files changed, 48 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e2748aad..a482154c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) +## [0.35.9] - 2023-12-06 + +- Fixes ThirdPartyEmailPassword rendering sign in/up switcher even with disabled email password. Instead it'll now render `SignInAndUpHeader` in this case (overrideable as `ThirdPartySignInAndUpHeader`) + ## [0.35.8] - 2023-11-26 - Fixes `inputComponent` props to make them non optional. This is in the context of customizing the sign up form to add custom react components. diff --git a/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts b/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts index b8ec36fd7..9c795dce2 100644 --- a/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts @@ -1,7 +1,7 @@ /// export declare const SubmitNewPassword: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { - formFields: import("../../../types").FormFieldThemeProps[]; + formFields: Omit[]; error: string | undefined; } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; diff --git a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts index 46dd93ed6..64639bb96 100644 --- a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts @@ -1,7 +1,7 @@ /// export declare const SignIn: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { - formFields: import("../../../types").FormFieldThemeProps[]; + formFields: Omit[]; error: string | undefined; } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; @@ -10,6 +10,6 @@ export declare const SignIn: import("react").ComponentType< config: import("../../../types").NormalisedConfig; signUpClicked?: (() => void) | undefined; forgotPasswordClick: () => void; - onSuccess: () => void; + onSuccess: (result: { user: import("supertokens-web-js/types").User }) => void; } >; diff --git a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts index 1a0268aa8..32bc386b1 100644 --- a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts @@ -1,14 +1,13 @@ /// export declare const SignUp: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { - formFields: import("../../../types").FormFieldThemeProps[]; - error: string | undefined; - } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; clearError: () => void; onError: (error: string) => void; config: import("../../../types").NormalisedConfig; signInClicked?: (() => void) | undefined; - onSuccess: () => void; + onSuccess: (result: { user: import("supertokens-web-js/types").User }) => void; + formFields: import("../../../types").FormFieldThemeProps[]; + error: string | undefined; } >; diff --git a/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts b/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts index bb256d116..454ff978e 100644 --- a/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts +++ b/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts @@ -58,6 +58,9 @@ export declare const defaultTranslationsThirdPartyEmailPassword: { "Password must contain at least one alphabet": undefined; "Password must contain at least one number": undefined; "Email is invalid": undefined; + "Reset password link was not created because of account take over risk. Please contact support. (ERR_CODE_001)": undefined; + "Cannot sign up due to security reasons. Please try logging in, use a different login method or contact support. (ERR_CODE_007)": undefined; + "Cannot sign in due to security reasons. Please try resetting your password, use a different login method or contact support. (ERR_CODE_008)": undefined; EMAIL_VERIFICATION_RESEND_SUCCESS: string; EMAIL_VERIFICATION_SEND_TITLE: string; EMAIL_VERIFICATION_SEND_DESC_START: string; @@ -86,5 +89,8 @@ export declare const defaultTranslationsThirdPartyEmailPassword: { THIRD_PARTY_PROVIDER_DEFAULT_BTN_START: string; THIRD_PARTY_PROVIDER_DEFAULT_BTN_END: string; THIRD_PARTY_ERROR_NO_EMAIL: string; + "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_004)": undefined; + "Cannot sign in / up because new email cannot be applied to existing account. Please contact support. (ERR_CODE_005)": undefined; + "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_006)": undefined; }; }; diff --git a/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts b/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts index dbe4e941e..b24b59e60 100644 --- a/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts +++ b/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts @@ -57,6 +57,8 @@ export declare const defaultTranslationsThirdPartyPasswordless: { "Failed to generate a one time code. Please try again": undefined; "Phone number is invalid": undefined; "Email is invalid": undefined; + "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_002)": undefined; + "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_003)": undefined; BRANDING_POWERED_BY_START: string; BRANDING_POWERED_BY_END: string; SOMETHING_WENT_WRONG_ERROR: string; @@ -69,5 +71,8 @@ export declare const defaultTranslationsThirdPartyPasswordless: { THIRD_PARTY_PROVIDER_DEFAULT_BTN_START: string; THIRD_PARTY_PROVIDER_DEFAULT_BTN_END: string; THIRD_PARTY_ERROR_NO_EMAIL: string; + "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_004)": undefined; + "Cannot sign in / up because new email cannot be applied to existing account. Please contact support. (ERR_CODE_005)": undefined; + "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_006)": undefined; }; }; diff --git a/lib/build/thirdparty-shared2.js b/lib/build/thirdparty-shared2.js index c5f17c5db..fcf0e2365 100644 --- a/lib/build/thirdparty-shared2.js +++ b/lib/build/thirdparty-shared2.js @@ -767,6 +767,7 @@ exports.ProvidersForm = ProvidersForm; exports.SignInAndUp = SignInAndUp; exports.SignInAndUpCallback = SignInAndUpCallback; exports.SignInAndUpCallbackTheme = SignInAndUpCallbackTheme; +exports.SignInAndUpHeader = SignInAndUpHeader; exports.SignInAndUpThemeWrapper = SignInAndUpThemeWrapper; exports.ThirdPartyPreBuiltUI = ThirdPartyPreBuiltUI; exports.defaultTranslationsThirdParty = defaultTranslationsThirdParty; diff --git a/lib/build/thirdpartyemailpasswordprebuiltui.js b/lib/build/thirdpartyemailpasswordprebuiltui.js index 091b64450..c71672a5e 100644 --- a/lib/build/thirdpartyemailpasswordprebuiltui.js +++ b/lib/build/thirdpartyemailpasswordprebuiltui.js @@ -157,12 +157,16 @@ var SignInAndUpTheme = function (props) { { "data-supertokens": "row" }, { children: [ - jsxRuntime.jsx(Header, { - isSignUp: props.epState.isSignUp, - setIsSignUp: function (isSignUp) { - return props.epDispatch({ type: isSignUp ? "setSignUp" : "setSignIn" }); - }, - }), + emailPasswordEnabled + ? jsxRuntime.jsx(Header, { + isSignUp: props.epState.isSignUp, + setIsSignUp: function (isSignUp) { + return props.epDispatch({ + type: isSignUp ? "setSignUp" : "setSignIn", + }); + }, + }) + : jsxRuntime.jsx(thirdpartyprebuiltui.SignInAndUpHeader, {}), props.commonState.error && jsxRuntime.jsx(generalError.GeneralError, { error: props.commonState.error }), props.tpChildProps !== undefined && diff --git a/lib/build/version.d.ts b/lib/build/version.d.ts index cfe379a1e..107d8c365 100644 --- a/lib/build/version.d.ts +++ b/lib/build/version.d.ts @@ -1 +1 @@ -export declare const package_version = "0.35.8"; +export declare const package_version = "0.35.9"; diff --git a/lib/ts/recipe/thirdpartyemailpassword/components/themes/signInAndUp/index.tsx b/lib/ts/recipe/thirdpartyemailpassword/components/themes/signInAndUp/index.tsx index 8b6c23339..9a11fce80 100644 --- a/lib/ts/recipe/thirdpartyemailpassword/components/themes/signInAndUp/index.tsx +++ b/lib/ts/recipe/thirdpartyemailpassword/components/themes/signInAndUp/index.tsx @@ -30,6 +30,7 @@ import { SignUpFooter } from "../../../../emailpassword/components/themes/signIn import { SignUpForm } from "../../../../emailpassword/components/themes/signInAndUp/signUpForm"; import { useDynamicLoginMethods } from "../../../../multitenancy/dynamicLoginMethodsContext"; import { ProvidersForm } from "../../../../thirdparty/components/themes/signInAndUp/providersForm"; +import { SignInAndUpHeader } from "../../../../thirdparty/components/themes/signInAndUp/signInAndUpHeader"; import { ThemeBase } from "../themeBase"; import { Header } from "./header"; @@ -62,10 +63,14 @@ const SignInAndUpTheme: React.FC = return (
-
props.epDispatch({ type: isSignUp ? "setSignUp" : "setSignIn" })} - /> + {emailPasswordEnabled ? ( +
props.epDispatch({ type: isSignUp ? "setSignUp" : "setSignIn" })} + /> + ) : ( + + )} {props.commonState.error && } {props.tpChildProps !== undefined && thirdPartyEnabled && ( diff --git a/lib/ts/version.ts b/lib/ts/version.ts index a6d28e815..b57e608d4 100644 --- a/lib/ts/version.ts +++ b/lib/ts/version.ts @@ -12,4 +12,4 @@ * License for the specific language governing permissions and limitations * under the License. */ -export const package_version = "0.35.8"; +export const package_version = "0.35.9"; diff --git a/package-lock.json b/package-lock.json index c16a56d1a..4617b0e00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "supertokens-auth-react", - "version": "0.35.8", + "version": "0.35.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "supertokens-auth-react", - "version": "0.35.8", + "version": "0.35.9", "license": "Apache-2.0", "dependencies": { "intl-tel-input": "^17.0.19", diff --git a/package.json b/package.json index cb820d2cf..ad3a5f8a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "supertokens-auth-react", - "version": "0.35.8", + "version": "0.35.9", "description": "ReactJS SDK that provides login functionality with SuperTokens.", "main": "./index.js", "engines": { diff --git a/test/end-to-end/multitenancy.dynamic_login_methods.test.js b/test/end-to-end/multitenancy.dynamic_login_methods.test.js index fc019b57c..f1f21583d 100644 --- a/test/end-to-end/multitenancy.dynamic_login_methods.test.js +++ b/test/end-to-end/multitenancy.dynamic_login_methods.test.js @@ -39,6 +39,7 @@ import { isMultitenancyManagementEndpointsSupported, setupTenant, backendBeforeEach, + getTextByDataSupertokens, } from "../helpers"; import { TEST_CLIENT_BASE_URL, @@ -530,6 +531,7 @@ describe("SuperTokens Multitenancy dynamic login methods", function () { // Emailpassword const inputNames = await getInputNames(page); assert.deepStrictEqual(inputNames, []); + assert.strictEqual(await getTextByDataSupertokens(page, "headerTitle"), "Sign Up / Sign In"); }); it("should show thirdpartyemailpassword if FE has tpep and both emailpassword and thirdparty is enabled", async function () { From 07fdb994560a172c099cdb9a18569caf1d39b3a0 Mon Sep 17 00:00:00 2001 From: rishabhpoddar Date: Wed, 6 Dec 2023 16:01:52 +0530 Subject: [PATCH 10/12] adding dev-v0.35.9 tag to this commit to ensure building --- docs/classes/index.default.html | 2 +- docs/classes/recipe_authRecipe.default.html | 2 +- docs/classes/recipe_emailpassword.default.html | 2 +- docs/classes/recipe_emailverification.default.html | 2 +- docs/classes/recipe_multitenancy.default.html | 2 +- docs/classes/recipe_passwordless.default.html | 2 +- docs/classes/recipe_recipeModule.default.html | 2 +- docs/classes/recipe_session.BooleanClaim.html | 2 +- docs/classes/recipe_session.PrimitiveArrayClaim.html | 2 +- docs/classes/recipe_session.PrimitiveClaim.html | 2 +- docs/classes/recipe_session.default.html | 2 +- docs/classes/recipe_thirdparty.ActiveDirectory.html | 2 +- docs/classes/recipe_thirdparty.Apple.html | 2 +- docs/classes/recipe_thirdparty.Bitbucket.html | 2 +- docs/classes/recipe_thirdparty.BoxySAML.html | 2 +- docs/classes/recipe_thirdparty.Discord.html | 2 +- docs/classes/recipe_thirdparty.Facebook.html | 2 +- docs/classes/recipe_thirdparty.Github.html | 2 +- docs/classes/recipe_thirdparty.Gitlab.html | 2 +- docs/classes/recipe_thirdparty.Google.html | 2 +- docs/classes/recipe_thirdparty.GoogleWorkspaces.html | 2 +- docs/classes/recipe_thirdparty.LinkedIn.html | 2 +- docs/classes/recipe_thirdparty.Okta.html | 2 +- docs/classes/recipe_thirdparty.Twitter.html | 2 +- docs/classes/recipe_thirdparty.default.html | 2 +- docs/classes/recipe_thirdpartyemailpassword.default.html | 2 +- docs/classes/recipe_thirdpartypasswordless.default.html | 2 +- docs/classes/recipe_userroles.default.html | 2 +- docs/modules/index.html | 2 +- docs/modules/recipe_emailpassword.html | 4 ++-- docs/modules/recipe_emailverification.html | 4 ++-- docs/modules/recipe_multitenancy.html | 2 +- docs/modules/recipe_passwordless.html | 4 ++-- docs/modules/recipe_session.html | 4 ++-- docs/modules/recipe_thirdparty.html | 4 ++-- docs/modules/recipe_thirdpartyemailpassword.html | 4 ++-- docs/modules/recipe_thirdpartypasswordless.html | 4 ++-- .../themes/resetPasswordUsingToken/submitNewPassword.d.ts | 2 +- .../components/themes/signInAndUp/signIn.d.ts | 4 ++-- .../components/themes/signInAndUp/signUp.d.ts | 7 ++++--- .../components/themes/translations.d.ts | 6 ------ .../components/themes/translations.d.ts | 5 ----- 42 files changed, 51 insertions(+), 61 deletions(-) diff --git a/docs/classes/index.default.html b/docs/classes/index.default.html index fb30dcf7b..8579c96fe 100644 --- a/docs/classes/index.default.html +++ b/docs/classes/index.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

SuperTokensWrapper: FC<PropsWithChildren<{ userContext?: any }>> = SuperTokensWrapper
useTranslation: (() => TranslationFunc) = useTranslation

Type declaration

    • (): TranslationFunc
    • Returns TranslationFunc

useUserContext: (() => any) = useUserContext

Type declaration

    • (): any
    • Returns any

Methods

  • changeLanguage(language: string): Promise<void>
  • init(config: SuperTokensConfig): void
  • loadTranslation(store: TranslationStore): void
  • redirectToAuth(options?: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }): Promise<void>
  • Parameters

    • Optional options: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }
      • Optional history?: any
      • Optional queryParams?: any
      • Optional redirectBack?: boolean
      • Optional show?: "signin" | "signup"

    Returns Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

SuperTokensWrapper: FC<PropsWithChildren<{ userContext?: any }>> = SuperTokensWrapper
useTranslation: (() => TranslationFunc) = useTranslation

Type declaration

    • (): TranslationFunc
    • Returns TranslationFunc

useUserContext: (() => any) = useUserContext

Type declaration

    • (): any
    • Returns any

Methods

  • changeLanguage(language: string): Promise<void>
  • init(config: SuperTokensConfig): void
  • loadTranslation(store: TranslationStore): void
  • redirectToAuth(options?: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }): Promise<void>
  • Parameters

    • Optional options: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }
      • Optional history?: any
      • Optional queryParams?: any
      • Optional redirectBack?: boolean
      • Optional show?: "signin" | "signup"

    Returns Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

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 a5eaa67a7..170770c2d 100644 --- a/docs/classes/recipe_authRecipe.default.html +++ b/docs/classes/recipe_authRecipe.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<T, Action, R, N> Abstract

Type Parameters

  • T

  • Action

  • R

  • N extends NormalisedConfig<T | GetRedirectionURLContext, Action, R | OnHandleEventContext>

Hierarchy

  • default<T | GetRedirectionURLContext, Action, R | OnHandleEventContext, N>
    • default

Index

Constructors

  • new default<T, Action, R, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<T, Action, R, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • doesSessionExist(input?: { userContext?: any }): Promise<boolean>
  • getAuthRecipeDefaultRedirectionURL(context: GetRedirectionURLContext): Promise<string>
  • getDefaultRedirectionURL(_: GetRedirectionURLContext | T): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>
  • signOut(input?: { userContext?: any }): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property
  • Inherited method

Settings

Theme

Generated using TypeDoc

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

Class default<T, Action, R, N> Abstract

Type Parameters

  • T

  • Action

  • R

  • N extends NormalisedConfig<T | GetRedirectionURLContext, Action, R | OnHandleEventContext>

Hierarchy

  • default<T | GetRedirectionURLContext, Action, R | OnHandleEventContext, N>
    • default

Index

Constructors

  • new default<T, Action, R, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<T, Action, R, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • doesSessionExist(input?: { userContext?: any }): Promise<boolean>
  • getAuthRecipeDefaultRedirectionURL(context: GetRedirectionURLContext): Promise<string>
  • getDefaultRedirectionURL(_: GetRedirectionURLContext | T): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>
  • signOut(input?: { userContext?: any }): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property
  • Inherited method

Settings

Theme

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 17dd7e299..de330e935 100644 --- a/docs/classes/recipe_emailpassword.default.html +++ b/docs/classes/recipe_emailpassword.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

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

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

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

  • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

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

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

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

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

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

  • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

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

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

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 991df5e80..496345c57 100644 --- a/docs/classes/recipe_emailverification.default.html +++ b/docs/classes/recipe_emailverification.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider
EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationRecipe.EmailVerificationClaim

Methods

  • getEmailVerificationTokenFromURL(input?: { userContext?: any }): string
  • isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>
  • Parameters

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

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

  • sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • Parameters

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

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

  • verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
  • Parameters

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider
EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationRecipe.EmailVerificationClaim

Methods

  • getEmailVerificationTokenFromURL(input?: { userContext?: any }): string
  • isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>
  • Parameters

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

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

  • sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • Parameters

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

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

  • verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
  • Parameters

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

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_multitenancy.default.html b/docs/classes/recipe_multitenancy.default.html index 28d2491b3..3bc8e79a4 100644 --- a/docs/classes/recipe_multitenancy.default.html +++ b/docs/classes/recipe_multitenancy.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

AllowedDomainsClaim: AllowedDomainsClaimClass = AllowedDomainsClaim
ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

AllowedDomainsClaim: AllowedDomainsClaimClass = AllowedDomainsClaim
ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_passwordless.default.html b/docs/classes/recipe_passwordless.default.html index f9d1679cc..5339b9cde 100644 --- a/docs/classes/recipe_passwordless.default.html +++ b/docs/classes/recipe_passwordless.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

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

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

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

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

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

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

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

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

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

    • CustomLoginAttemptInfoProperties

    Parameters

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

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

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

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

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

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

    • CustomStateProperties

    Parameters

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

    Returns Promise<void>

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

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

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

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

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

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

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

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

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

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

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

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

    • CustomLoginAttemptInfoProperties

    Parameters

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

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

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

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

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

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

    • CustomStateProperties

    Parameters

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

    Returns Promise<void>

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_recipeModule.default.html b/docs/classes/recipe_recipeModule.default.html index f05cb1ccd..95d92f9af 100644 --- a/docs/classes/recipe_recipeModule.default.html +++ b/docs/classes/recipe_recipeModule.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N> Abstract

Type Parameters

  • GetRedirectionURLContextType

  • Action

  • OnHandleEventContextType

  • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

Hierarchy

  • BaseRecipeModule<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Index

Constructors

  • new default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>
  • Type Parameters

    • GetRedirectionURLContextType

    • Action

    • OnHandleEventContextType

    • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

    Parameters

    • config: NormalisedConfigWithAppInfoAndRecipeID<N>

    Returns default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • getDefaultRedirectionURL(_: GetRedirectionURLContextType): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property

Settings

Theme

Generated using TypeDoc

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

Class default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N> Abstract

Type Parameters

  • GetRedirectionURLContextType

  • Action

  • OnHandleEventContextType

  • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

Hierarchy

  • BaseRecipeModule<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Index

Constructors

  • new default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>
  • Type Parameters

    • GetRedirectionURLContextType

    • Action

    • OnHandleEventContextType

    • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

    Parameters

    • config: NormalisedConfigWithAppInfoAndRecipeID<N>

    Returns default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • getDefaultRedirectionURL(_: GetRedirectionURLContextType): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_session.BooleanClaim.html b/docs/classes/recipe_session.BooleanClaim.html index 645ade2df..7222cbdd9 100644 --- a/docs/classes/recipe_session.BooleanClaim.html +++ b/docs/classes/recipe_session.BooleanClaim.html @@ -1,3 +1,3 @@ -BooleanClaim | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • BooleanClaim
    • BooleanClaim

Index

Constructors

  • new BooleanClaim(config: PrimitiveClaimConfig & { onFailureRedirection?: ValidationFailureCallback; showAccessDeniedOnFailure?: boolean }): BooleanClaim
  • Parameters

    • config: PrimitiveClaimConfig & { onFailureRedirection?: ValidationFailureCallback; showAccessDeniedOnFailure?: boolean }

    Returns BooleanClaim

Properties

defaultMaxAgeInSeconds: undefined | number
id: string
refresh: ((userContext: any) => Promise<void>)

Type declaration

UserInput: { override?: { functions?: any } } & RecipeModuleUserInput<any, PreAndPostAPIHookAction, any>

Variables

AllowedDomainsClaim: AllowedDomainsClaimClass
MultitenancyComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

Functions

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

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 diff --git a/docs/modules/recipe_passwordless.html b/docs/modules/recipe_passwordless.html index 9752c3cd6..a9e752326 100644 --- a/docs/modules/recipe_passwordless.html +++ b/docs/modules/recipe_passwordless.html @@ -1,4 +1,4 @@ -recipe/passwordless | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

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

Type declaration

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

Type declaration

  • clearLoginAttemptInfo:function
    • clearLoginAttemptInfo(input: { userContext: any }): Promise<void>
    • +recipe/passwordless | supertokens-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Type Aliases

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

      Type declaration

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

      Type declaration

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

          Parameters

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

          Returns Promise<void>

      • consumeCode:function
        • consumeCode(input: { deviceId: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any; userInputCode: string } | { linkCode: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
        • Log the user in using the input code or link code

          @@ -34,4 +34,4 @@

          Parameters

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

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

          {status: "OK"} if succesful

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

          -

          Type Parameters

          • CustomStateProperties

          Parameters

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

          Returns Promise<void>

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

      Variables

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

      Functions

      • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
      • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

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

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

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

        • input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
          • email: string
          • Optional options?: RecipeFunctionOptions
          • Optional userContext?: any

        Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

      • doesPhoneNumberExist(input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
      • Parameters

        • input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }
          • Optional options?: RecipeFunctionOptions
          • phoneNumber: string
          • Optional userContext?: any

        Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

      • getLinkCodeFromURL(input?: { userContext?: any }): string
      • getLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input?: { userContext?: any }): Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties>
      • Type Parameters

        • CustomLoginAttemptInfoProperties

        Parameters

        • Optional input: { userContext?: any }
          • Optional userContext?: any

        Returns Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties>

      • getPreAuthSessionIdFromURL(input?: { userContext?: any }): string
      • resendCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
      • Parameters

        • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
          • Optional options?: RecipeFunctionOptions
          • Optional userContext?: any

        Returns Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>

      • setLoginAttemptInfo<CustomStateProperties>(input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }): Promise<void>
      • Type Parameters

        • CustomStateProperties

        Parameters

        • input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }
          • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties
          • Optional userContext?: any

        Returns Promise<void>

      • signOut(input?: { userContext?: any }): Promise<void>

      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: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomStateProperties; userContext: any }
        • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomStateProperties
        • userContext: any

      Returns Promise<void>

UserInput: ({ contactMethod: "EMAIL"; signInUpFeature?: SignInUpFeatureConfigInput; validateEmailAddress?: any } | { contactMethod: "PHONE"; signInUpFeature?: SignInUpFeatureConfigInput & { defaultCountry?: string }; validatePhoneNumber?: any } | { contactMethod: "EMAIL_OR_PHONE"; signInUpFeature?: SignInUpFeatureConfigInput & { defaultCountry?: string; guessInternationPhoneNumberFromInputPhoneNumber?: any }; validateEmailAddress?: any; validatePhoneNumber?: any }) & { linkClickedScreenFeature?: PasswordlessFeatureBaseConfig; override?: { functions?: any } } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

PasswordlessComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

Functions

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; 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" }>

  • createCode(input: { email: string; options?: RecipeFunctionOptions; userContext?: any } | { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • 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" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

  • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
      • email: string
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

  • doesPhoneNumberExist(input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • phoneNumber: string
      • Optional userContext?: any

    Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

  • getLinkCodeFromURL(input?: { userContext?: any }): string
  • getLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input?: { userContext?: any }): Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties>
  • Type Parameters

    • CustomLoginAttemptInfoProperties

    Parameters

    • Optional input: { userContext?: any }
      • Optional userContext?: any

    Returns Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties>

  • getPreAuthSessionIdFromURL(input?: { userContext?: any }): string
  • resendCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>

  • setLoginAttemptInfo<CustomStateProperties>(input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }): Promise<void>
  • Type Parameters

    • CustomStateProperties

    Parameters

    • input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }
      • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties
      • Optional userContext?: any

    Returns Promise<void>

  • signOut(input?: { userContext?: any }): Promise<void>

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 diff --git a/docs/modules/recipe_session.html b/docs/modules/recipe_session.html index bf384b754..2dab2892a 100644 --- a/docs/modules/recipe_session.html +++ b/docs/modules/recipe_session.html @@ -1,8 +1,8 @@ -recipe/session | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

ClaimValidationError: { reason?: any; validatorId: string }

Type declaration

  • Optional reason?: any
  • validatorId: string
ClaimValidationResult: { isValid: true } | { isValid: false; reason?: any }
InputType: WebJSInputType & { accessDeniedScreen?: SessionFeatureBaseConfig; style?: string; onHandleEvent?: any }
RecipeInterface: { addAxiosInterceptors: any; addFetchInterceptorsAndReturnModifiedFetch: any; addXMLHttpRequestInterceptor: any; doesSessionExist: any; getAccessTokenPayloadSecurely: any; getGlobalClaimValidators: any; getInvalidClaimsFromResponse: any; getUserId: any; shouldDoInterceptionBasedOnUrl: any; signOut: any; validateClaims: any }

Type declaration

  • addAxiosInterceptors:function
    • addAxiosInterceptors(input: { axiosInstance: any; userContext: any }): void
    • Parameters

      • input: { axiosInstance: any; userContext: any }
        • axiosInstance: any
        • userContext: any

      Returns void

  • addFetchInterceptorsAndReturnModifiedFetch:function
    • addFetchInterceptorsAndReturnModifiedFetch(input: { originalFetch: any; userContext: any }): ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)
    • Parameters

      • input: { originalFetch: any; userContext: any }
        • originalFetch: any
        • userContext: any

      Returns ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)

        • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
        • Parameters

          • input: URL | RequestInfo
          • Optional init: RequestInit

          Returns Promise<Response>

  • addXMLHttpRequestInterceptor:function
    • addXMLHttpRequestInterceptor(input: { userContext: any }): void
    • Parameters

      • input: { userContext: any }
        • userContext: any

      Returns void

  • doesSessionExist:function
    • doesSessionExist(input: { userContext: any }): Promise<boolean>
    • Parameters

      • input: { userContext: any }
        • userContext: any

      Returns Promise<boolean>

  • getAccessTokenPayloadSecurely:function
    • getAccessTokenPayloadSecurely(input: { userContext: any }): Promise<any>
    • Parameters

      • input: { userContext: any }
        • userContext: any

      Returns Promise<any>

  • getGlobalClaimValidators:function
  • getInvalidClaimsFromResponse:function
    • getInvalidClaimsFromResponse(input: { response: { data: any } | Response; userContext: any }): Promise<ClaimValidationError[]>
    • Parameters

      • input: { response: { data: any } | Response; userContext: any }
        • response: { data: any } | Response
        • userContext: any

      Returns Promise<ClaimValidationError[]>

  • getUserId:function
    • getUserId(input: { userContext: any }): Promise<string>
    • Parameters

      • input: { userContext: any }
        • userContext: any

      Returns Promise<string>

  • shouldDoInterceptionBasedOnUrl:function
    • shouldDoInterceptionBasedOnUrl(toCheckUrl: string, apiDomain: string, sessionTokenBackendDomain: undefined | string): boolean
    • Parameters

      • toCheckUrl: string
      • apiDomain: string
      • sessionTokenBackendDomain: undefined | string

      Returns boolean

  • signOut:function
    • signOut(input: { userContext: any }): Promise<void>
    • Parameters

      • input: { userContext: any }
        • userContext: any

      Returns Promise<void>

  • validateClaims:function
SessionClaim<ValueType>: { getLastFetchedTime: any; getValueFromPayload: any; refresh: any }

Type Parameters

  • ValueType

Type declaration

  • getLastFetchedTime:function
    • getLastFetchedTime(payload: any, _userContext?: any): undefined | number
    • Parameters

      • payload: any
      • Optional _userContext: any

      Returns undefined | number

  • getValueFromPayload:function
    • getValueFromPayload(payload: any, _userContext?: any): undefined | ValueType
    • Parameters

      • payload: any
      • Optional _userContext: any

      Returns undefined | ValueType

  • refresh:function
    • refresh(userContext: any): Promise<void>
    • Parameters

      • userContext: any

      Returns Promise<void>

SessionClaimValidator: { id: string; refresh: any; shouldRefresh: any; validate: any }

Type declaration

  • Readonly id: string
  • refresh:function
    • refresh(userContext: any): Promise<void>
    • +recipe/session | supertokens-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Type Aliases

      ClaimValidationError: { reason?: any; validatorId: string }

      Type declaration

      • Optional reason?: any
      • validatorId: string
      ClaimValidationResult: { isValid: true } | { isValid: false; reason?: any }
      InputType: WebJSInputType & { accessDeniedScreen?: SessionFeatureBaseConfig; style?: string; onHandleEvent?: any }
      RecipeInterface: { addAxiosInterceptors: any; addFetchInterceptorsAndReturnModifiedFetch: any; addXMLHttpRequestInterceptor: any; doesSessionExist: any; getAccessTokenPayloadSecurely: any; getGlobalClaimValidators: any; getInvalidClaimsFromResponse: any; getUserId: any; shouldDoInterceptionBasedOnUrl: any; signOut: any; validateClaims: any }

      Type declaration

      • addAxiosInterceptors:function
        • addAxiosInterceptors(input: { axiosInstance: any; userContext: any }): void
        • Parameters

          • input: { axiosInstance: any; userContext: any }
            • axiosInstance: any
            • userContext: any

          Returns void

      • addFetchInterceptorsAndReturnModifiedFetch:function
        • addFetchInterceptorsAndReturnModifiedFetch(input: { originalFetch: any; userContext: any }): ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)
        • Parameters

          • input: { originalFetch: any; userContext: any }
            • originalFetch: any
            • userContext: any

          Returns ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)

            • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
            • Parameters

              • input: URL | RequestInfo
              • Optional init: RequestInit

              Returns Promise<Response>

      • addXMLHttpRequestInterceptor:function
        • addXMLHttpRequestInterceptor(input: { userContext: any }): void
        • Parameters

          • input: { userContext: any }
            • userContext: any

          Returns void

      • doesSessionExist:function
        • doesSessionExist(input: { userContext: any }): Promise<boolean>
        • Parameters

          • input: { userContext: any }
            • userContext: any

          Returns Promise<boolean>

      • getAccessTokenPayloadSecurely:function
        • getAccessTokenPayloadSecurely(input: { userContext: any }): Promise<any>
        • Parameters

          • input: { userContext: any }
            • userContext: any

          Returns Promise<any>

      • getGlobalClaimValidators:function
      • getInvalidClaimsFromResponse:function
        • getInvalidClaimsFromResponse(input: { response: { data: any } | Response; userContext: any }): Promise<ClaimValidationError[]>
        • Parameters

          • input: { response: { data: any } | Response; userContext: any }
            • response: { data: any } | Response
            • userContext: any

          Returns Promise<ClaimValidationError[]>

      • getUserId:function
        • getUserId(input: { userContext: any }): Promise<string>
        • Parameters

          • input: { userContext: any }
            • userContext: any

          Returns Promise<string>

      • shouldDoInterceptionBasedOnUrl:function
        • shouldDoInterceptionBasedOnUrl(toCheckUrl: string, apiDomain: string, sessionTokenBackendDomain: undefined | string): boolean
        • Parameters

          • toCheckUrl: string
          • apiDomain: string
          • sessionTokenBackendDomain: undefined | string

          Returns boolean

      • signOut:function
        • signOut(input: { userContext: any }): Promise<void>
        • Parameters

          • input: { userContext: any }
            • userContext: any

          Returns Promise<void>

      • validateClaims:function
      SessionClaim<ValueType>: { getLastFetchedTime: any; getValueFromPayload: any; refresh: any }

      Type Parameters

      • ValueType

      Type declaration

      • getLastFetchedTime:function
        • getLastFetchedTime(payload: any, _userContext?: any): undefined | number
        • Parameters

          • payload: any
          • Optional _userContext: any

          Returns undefined | number

      • getValueFromPayload:function
        • getValueFromPayload(payload: any, _userContext?: any): undefined | ValueType
        • Parameters

          • payload: any
          • Optional _userContext: any

          Returns undefined | ValueType

      • refresh:function
        • refresh(userContext: any): Promise<void>
        • Parameters

          • userContext: any

          Returns Promise<void>

      SessionClaimValidator: { id: string; refresh: any; shouldRefresh: any; validate: any }

      Type declaration

      • Readonly id: string
      • refresh:function
        • refresh(userContext: any): Promise<void>
        • Makes an API call that will refresh the claim in the token.

          Parameters

          • userContext: any

          Returns Promise<void>

      • shouldRefresh:function
        • shouldRefresh(accessTokenPayload: any, userContext: any): boolean | Promise<boolean>
        • Decides if we need to refresh the claim value before checking the payload with validate. E.g.: if the information in the payload is expired, or is not sufficient for this validator.

          Parameters

          • accessTokenPayload: any
          • userContext: any

          Returns boolean | Promise<boolean>

      • 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>

      SessionContextType: LoadedSessionContext | { loading: true }

      Variables

      SessionAuth: FC<PropsWithChildren<SessionAuthProps & { userContext?: any }>> = SessionAPIWrapper.SessionAuth
      SessionComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = SessionAPIWrapper.ComponentsOverrideProvider
      SessionContext: Context<{ accessDeniedValidatorError?: ClaimValidationError; invalidClaims: ClaimValidationError[]; loading: false } & SessionContextUpdate & { isDefault?: boolean } & { loading: true } & { isDefault?: boolean }> = ...

      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?: InputType): RecipeInitResult<unknown, unknown, unknown, any>
      • signOut(input?: { userContext?: any }): Promise<void>
      • useClaimValue<T>(claim: SessionClaim<T>): { loading: true } | { doesSessionExist: boolean; loading: false; value: undefined | T }

      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 +

      Parameters

      • accessTokenPayload: any
      • userContext: any

      Returns ClaimValidationResult | Promise<ClaimValidationResult>

SessionContextType: LoadedSessionContext | { loading: true }

Variables

SessionAuth: FC<PropsWithChildren<SessionAuthProps & { userContext?: any }>> = SessionAPIWrapper.SessionAuth
SessionComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = SessionAPIWrapper.ComponentsOverrideProvider
SessionContext: Context<{ accessDeniedValidatorError?: ClaimValidationError; invalidClaims: ClaimValidationError[]; loading: false } & SessionContextUpdate & { isDefault?: boolean } & { loading: true } & { isDefault?: boolean }> = ...

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?: InputType): RecipeInitResult<unknown, unknown, unknown, any>
  • signOut(input?: { userContext?: any }): Promise<void>
  • useClaimValue<T>(claim: SessionClaim<T>): { loading: true } | { doesSessionExist: boolean; loading: false; value: undefined | T }

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 diff --git a/docs/modules/recipe_thirdparty.html b/docs/modules/recipe_thirdparty.html index 35aea0c46..27f6b5f19 100644 --- a/docs/modules/recipe_thirdparty.html +++ b/docs/modules/recipe_thirdparty.html @@ -1,4 +1,4 @@ -recipe/thirdparty | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

GetRedirectionURLContext: AuthRecipeModuleGetRedirectionURLContext
OnHandleEventContext: AuthRecipeModuleOnHandleEventContext | { action: "SUCCESS"; isNewRecipeUser: boolean; user: User; userContext: any }
PreAPIHookContext: { action: PreAndPostAPIHookAction; requestInit: RequestInit; url: string; userContext: any }

Type declaration

  • action: PreAndPostAPIHookAction
  • requestInit: RequestInit
  • url: string
  • userContext: any
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-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Type Aliases

      GetRedirectionURLContext: AuthRecipeModuleGetRedirectionURLContext
      OnHandleEventContext: AuthRecipeModuleOnHandleEventContext | { action: "SUCCESS"; isNewRecipeUser: boolean; user: User; userContext: any }
      PreAPIHookContext: { action: PreAndPostAPIHookAction; requestInit: RequestInit; url: string; userContext: any }

      Type declaration

      • action: PreAndPostAPIHookAction
      • requestInit: RequestInit
      • url: string
      • userContext: any
      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
        • @@ -26,4 +26,4 @@

          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

      • 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: { oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

      Variables

      ThirdpartyComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

      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
      • Type Parameters

        • CustomStateProperties

        Parameters

        • Optional input: { userContext?: any }
          • Optional userContext?: any

        Returns undefined | StateObject & CustomStateProperties

      • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
      • Parameters

        • input: { thirdPartyId: string; userContext?: any }
          • thirdPartyId: string
          • Optional userContext?: any

        Returns Promise<{ status: "OK" | "ERROR" }>

      • 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

        • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
          • Optional options?: RecipeFunctionOptions
          • Optional userContext?: any

        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>

UserInput: { oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

ThirdpartyComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

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
  • Type Parameters

    • CustomStateProperties

    Parameters

    • Optional input: { userContext?: any }
      • Optional userContext?: any

    Returns undefined | StateObject & CustomStateProperties

  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
  • Parameters

    • input: { thirdPartyId: string; userContext?: any }
      • thirdPartyId: string
      • Optional userContext?: any

    Returns Promise<{ status: "OK" | "ERROR" }>

  • 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

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    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 diff --git a/docs/modules/recipe_thirdpartyemailpassword.html b/docs/modules/recipe_thirdpartyemailpassword.html index deb0a018d..ace8449e7 100644 --- a/docs/modules/recipe_thirdpartyemailpassword.html +++ b/docs/modules/recipe_thirdpartyemailpassword.html @@ -1,4 +1,4 @@ -recipe/thirdpartyemailpassword | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/thirdpartyemailpassword

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: { 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-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Module recipe/thirdpartyemailpassword

      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: { 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" }>
        • Check if an 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}

          @@ -51,4 +51,4 @@

          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

      • 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: { disableEmailPassword?: boolean; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; resetPasswordUsingTokenFeature?: ResetPasswordUsingTokenUserInput; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

      Variables

      ThirdpartyEmailPasswordComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

      Functions

      • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
      • Parameters

        • input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
          • email: string
          • Optional options?: RecipeFunctionOptions
          • Optional userContext?: any

        Returns 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>
      • 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>

      • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
      • getStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
      • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
      • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "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" }>
      • Parameters

        • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
          • Optional options?: RecipeFunctionOptions
          • Optional userContext?: any

        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: { disableEmailPassword?: boolean; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; resetPasswordUsingTokenFeature?: ResetPasswordUsingTokenUserInput; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

ThirdpartyEmailPasswordComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

Functions

  • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
      • email: string
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns 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>
  • 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>

  • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
  • getStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "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" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    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 diff --git a/docs/modules/recipe_thirdpartypasswordless.html b/docs/modules/recipe_thirdpartypasswordless.html index 212e88363..14e0c8539 100644 --- a/docs/modules/recipe_thirdpartypasswordless.html +++ b/docs/modules/recipe_thirdpartypasswordless.html @@ -1,4 +1,4 @@ -recipe/thirdpartypasswordless | supertokens-auth-react
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>
    • +recipe/thirdpartypasswordless | supertokens-auth-react
      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

          @@ -62,4 +62,4 @@

          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; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any } } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

      Variables

      ThirdpartyPasswordlessComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

      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

        • Optional input: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; 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" }>

      • 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" }>
      • 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" }>

      • doesPasswordlessUserEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
      • Parameters

        • input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
          • email: string
          • Optional options?: RecipeFunctionOptions
          • Optional userContext?: any

        Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

      • doesPasswordlessUserPhoneNumberExist(input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
      • Parameters

        • input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }
          • Optional options?: RecipeFunctionOptions
          • phoneNumber: string
          • Optional userContext?: any

        Returns 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 } & CustomLoginAttemptInfoProperties>
      • Type Parameters

        • CustomLoginAttemptInfoProperties

        Parameters

        • Optional input: { userContext?: any }
          • Optional userContext?: any

        Returns Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties>

      • getPasswordlessPreAuthSessionIdFromURL(input?: { userContext?: any }): string
      • getThirdPartyAuthorisationURLWithQueryParamsAndSetState(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>

      • getThirdPartyStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
      • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
      • resendPasswordlessCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
      • Parameters

        • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
          • Optional options?: RecipeFunctionOptions
          • Optional userContext?: any

        Returns Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>

      • setPasswordlessLoginAttemptInfo<CustomStateProperties>(input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }): Promise<void>
      • Type Parameters

        • CustomStateProperties

        Parameters

        • input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }
          • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties
          • Optional userContext?: any

        Returns Promise<void>

      • signOut(input?: { userContext?: any }): Promise<void>
      • thirdPartySignInAndUp(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
          • Optional options?: RecipeFunctionOptions
          • Optional userContext?: any

        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: ({ 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; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any } } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

ThirdpartyPasswordlessComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

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

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; 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" }>

  • 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" }>
  • 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" }>

  • doesPasswordlessUserEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
      • email: string
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

  • doesPasswordlessUserPhoneNumberExist(input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • phoneNumber: string
      • Optional userContext?: any

    Returns 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 } & CustomLoginAttemptInfoProperties>
  • Type Parameters

    • CustomLoginAttemptInfoProperties

    Parameters

    • Optional input: { userContext?: any }
      • Optional userContext?: any

    Returns Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties>

  • getPasswordlessPreAuthSessionIdFromURL(input?: { userContext?: any }): string
  • getThirdPartyAuthorisationURLWithQueryParamsAndSetState(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>

  • getThirdPartyStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
  • resendPasswordlessCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>

  • setPasswordlessLoginAttemptInfo<CustomStateProperties>(input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }): Promise<void>
  • Type Parameters

    • CustomStateProperties

    Parameters

    • input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }
      • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties
      • Optional userContext?: any

    Returns Promise<void>

  • signOut(input?: { userContext?: any }): Promise<void>
  • thirdPartySignInAndUp(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    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 diff --git a/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts b/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts index 9c795dce2..b8ec36fd7 100644 --- a/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts @@ -1,7 +1,7 @@ /// export declare const SubmitNewPassword: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { - formFields: Omit[]; + formFields: import("../../../types").FormFieldThemeProps[]; error: string | undefined; } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; diff --git a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts index 64639bb96..46dd93ed6 100644 --- a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts @@ -1,7 +1,7 @@ /// export declare const SignIn: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { - formFields: Omit[]; + formFields: import("../../../types").FormFieldThemeProps[]; error: string | undefined; } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; @@ -10,6 +10,6 @@ export declare const SignIn: import("react").ComponentType< config: import("../../../types").NormalisedConfig; signUpClicked?: (() => void) | undefined; forgotPasswordClick: () => void; - onSuccess: (result: { user: import("supertokens-web-js/types").User }) => void; + onSuccess: () => void; } >; diff --git a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts index 32bc386b1..1a0268aa8 100644 --- a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts @@ -1,13 +1,14 @@ /// export declare const SignUp: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { + formFields: import("../../../types").FormFieldThemeProps[]; + error: string | undefined; + } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; clearError: () => void; onError: (error: string) => void; config: import("../../../types").NormalisedConfig; signInClicked?: (() => void) | undefined; - onSuccess: (result: { user: import("supertokens-web-js/types").User }) => void; - formFields: import("../../../types").FormFieldThemeProps[]; - error: string | undefined; + onSuccess: () => void; } >; diff --git a/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts b/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts index 454ff978e..bb256d116 100644 --- a/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts +++ b/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts @@ -58,9 +58,6 @@ export declare const defaultTranslationsThirdPartyEmailPassword: { "Password must contain at least one alphabet": undefined; "Password must contain at least one number": undefined; "Email is invalid": undefined; - "Reset password link was not created because of account take over risk. Please contact support. (ERR_CODE_001)": undefined; - "Cannot sign up due to security reasons. Please try logging in, use a different login method or contact support. (ERR_CODE_007)": undefined; - "Cannot sign in due to security reasons. Please try resetting your password, use a different login method or contact support. (ERR_CODE_008)": undefined; EMAIL_VERIFICATION_RESEND_SUCCESS: string; EMAIL_VERIFICATION_SEND_TITLE: string; EMAIL_VERIFICATION_SEND_DESC_START: string; @@ -89,8 +86,5 @@ export declare const defaultTranslationsThirdPartyEmailPassword: { THIRD_PARTY_PROVIDER_DEFAULT_BTN_START: string; THIRD_PARTY_PROVIDER_DEFAULT_BTN_END: string; THIRD_PARTY_ERROR_NO_EMAIL: string; - "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_004)": undefined; - "Cannot sign in / up because new email cannot be applied to existing account. Please contact support. (ERR_CODE_005)": undefined; - "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_006)": undefined; }; }; diff --git a/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts b/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts index b24b59e60..dbe4e941e 100644 --- a/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts +++ b/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts @@ -57,8 +57,6 @@ export declare const defaultTranslationsThirdPartyPasswordless: { "Failed to generate a one time code. Please try again": undefined; "Phone number is invalid": undefined; "Email is invalid": undefined; - "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_002)": undefined; - "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_003)": undefined; BRANDING_POWERED_BY_START: string; BRANDING_POWERED_BY_END: string; SOMETHING_WENT_WRONG_ERROR: string; @@ -71,8 +69,5 @@ export declare const defaultTranslationsThirdPartyPasswordless: { THIRD_PARTY_PROVIDER_DEFAULT_BTN_START: string; THIRD_PARTY_PROVIDER_DEFAULT_BTN_END: string; THIRD_PARTY_ERROR_NO_EMAIL: string; - "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_004)": undefined; - "Cannot sign in / up because new email cannot be applied to existing account. Please contact support. (ERR_CODE_005)": undefined; - "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_006)": undefined; }; }; From ad5cd3b56dac9baedaad6ae0bb22f5353895f494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mih=C3=A1ly=20Lengyel?= Date: Wed, 6 Dec 2023 12:36:33 +0100 Subject: [PATCH 11/12] fix: move SignInAndUpHeader inside ThirdPartyEmailPasswordHeader to improve overrides (#771) --- CHANGELOG.md | 3 +- .../submitNewPassword.d.ts | 2 +- .../components/themes/signInAndUp/signIn.d.ts | 4 +-- .../components/themes/signInAndUp/signUp.d.ts | 7 ++--- .../components/themes/signInAndUp/header.d.ts | 1 + .../components/themes/translations.d.ts | 6 ++++ .../components/themes/translations.d.ts | 5 +++ .../thirdpartyemailpasswordprebuiltui.js | 31 ++++++++----------- .../components/themes/signInAndUp/header.tsx | 16 +++++----- .../components/themes/signInAndUp/index.tsx | 16 ++++------ 10 files changed, 46 insertions(+), 45 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a482154c5..001fe6133 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.35.9] - 2023-12-06 -- Fixes ThirdPartyEmailPassword rendering sign in/up switcher even with disabled email password. Instead it'll now render `SignInAndUpHeader` in this case (overrideable as `ThirdPartySignInAndUpHeader`) +- Fixes ThirdPartyEmailPassword rendering sign in/up switcher even with disabled email password. Instead it'll now render `SignInAndUpHeader_Override` in this case (overrideable as `ThirdPartySignInAndUpHeader`). Overriding `ThirdPartyEmailPasswordHeader_Override` should still cover all cases. +- Added a new prop to `ThirdPartyEmailPasswordHeader_Override` you can use to check if email password is enabled. ## [0.35.8] - 2023-11-26 diff --git a/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts b/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts index b8ec36fd7..9c795dce2 100644 --- a/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts @@ -1,7 +1,7 @@ /// export declare const SubmitNewPassword: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { - formFields: import("../../../types").FormFieldThemeProps[]; + formFields: Omit[]; error: string | undefined; } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; diff --git a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts index 46dd93ed6..64639bb96 100644 --- a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts @@ -1,7 +1,7 @@ /// export declare const SignIn: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { - formFields: import("../../../types").FormFieldThemeProps[]; + formFields: Omit[]; error: string | undefined; } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; @@ -10,6 +10,6 @@ export declare const SignIn: import("react").ComponentType< config: import("../../../types").NormalisedConfig; signUpClicked?: (() => void) | undefined; forgotPasswordClick: () => void; - onSuccess: () => void; + onSuccess: (result: { user: import("supertokens-web-js/types").User }) => void; } >; diff --git a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts index 1a0268aa8..32bc386b1 100644 --- a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts @@ -1,14 +1,13 @@ /// export declare const SignUp: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { - formFields: import("../../../types").FormFieldThemeProps[]; - error: string | undefined; - } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; clearError: () => void; onError: (error: string) => void; config: import("../../../types").NormalisedConfig; signInClicked?: (() => void) | undefined; - onSuccess: () => void; + onSuccess: (result: { user: import("supertokens-web-js/types").User }) => void; + formFields: import("../../../types").FormFieldThemeProps[]; + error: string | undefined; } >; diff --git a/lib/build/recipe/thirdpartyemailpassword/components/themes/signInAndUp/header.d.ts b/lib/build/recipe/thirdpartyemailpassword/components/themes/signInAndUp/header.d.ts index d6afb97cf..a27422f48 100644 --- a/lib/build/recipe/thirdpartyemailpassword/components/themes/signInAndUp/header.d.ts +++ b/lib/build/recipe/thirdpartyemailpassword/components/themes/signInAndUp/header.d.ts @@ -1,5 +1,6 @@ /// export declare const Header: import("react").ComponentType<{ + emailPasswordEnabled: boolean; isSignUp: boolean; setIsSignUp: (isSignUp: boolean) => void; }>; diff --git a/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts b/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts index bb256d116..454ff978e 100644 --- a/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts +++ b/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts @@ -58,6 +58,9 @@ export declare const defaultTranslationsThirdPartyEmailPassword: { "Password must contain at least one alphabet": undefined; "Password must contain at least one number": undefined; "Email is invalid": undefined; + "Reset password link was not created because of account take over risk. Please contact support. (ERR_CODE_001)": undefined; + "Cannot sign up due to security reasons. Please try logging in, use a different login method or contact support. (ERR_CODE_007)": undefined; + "Cannot sign in due to security reasons. Please try resetting your password, use a different login method or contact support. (ERR_CODE_008)": undefined; EMAIL_VERIFICATION_RESEND_SUCCESS: string; EMAIL_VERIFICATION_SEND_TITLE: string; EMAIL_VERIFICATION_SEND_DESC_START: string; @@ -86,5 +89,8 @@ export declare const defaultTranslationsThirdPartyEmailPassword: { THIRD_PARTY_PROVIDER_DEFAULT_BTN_START: string; THIRD_PARTY_PROVIDER_DEFAULT_BTN_END: string; THIRD_PARTY_ERROR_NO_EMAIL: string; + "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_004)": undefined; + "Cannot sign in / up because new email cannot be applied to existing account. Please contact support. (ERR_CODE_005)": undefined; + "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_006)": undefined; }; }; diff --git a/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts b/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts index dbe4e941e..b24b59e60 100644 --- a/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts +++ b/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts @@ -57,6 +57,8 @@ export declare const defaultTranslationsThirdPartyPasswordless: { "Failed to generate a one time code. Please try again": undefined; "Phone number is invalid": undefined; "Email is invalid": undefined; + "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_002)": undefined; + "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_003)": undefined; BRANDING_POWERED_BY_START: string; BRANDING_POWERED_BY_END: string; SOMETHING_WENT_WRONG_ERROR: string; @@ -69,5 +71,8 @@ export declare const defaultTranslationsThirdPartyPasswordless: { THIRD_PARTY_PROVIDER_DEFAULT_BTN_START: string; THIRD_PARTY_PROVIDER_DEFAULT_BTN_END: string; THIRD_PARTY_ERROR_NO_EMAIL: string; + "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_004)": undefined; + "Cannot sign in / up because new email cannot be applied to existing account. Please contact support. (ERR_CODE_005)": undefined; + "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_006)": undefined; }; }; diff --git a/lib/build/thirdpartyemailpasswordprebuiltui.js b/lib/build/thirdpartyemailpasswordprebuiltui.js index c71672a5e..05e8fa3f2 100644 --- a/lib/build/thirdpartyemailpasswordprebuiltui.js +++ b/lib/build/thirdpartyemailpasswordprebuiltui.js @@ -96,15 +96,13 @@ var ThemeBase = function (_a) { }); }; -/* - * Component. - */ var Header = uiEntry.withOverride("ThirdPartyEmailPasswordHeader", function ThirdPartyEmailPasswordHeader(_a) { var isSignUp = _a.isSignUp, - setIsSignUp = _a.setIsSignUp; - /* - * Render. - */ + setIsSignUp = _a.setIsSignUp, + emailPasswordEnabled = _a.emailPasswordEnabled; + if (emailPasswordEnabled !== true) { + return jsxRuntime.jsx(thirdpartyprebuiltui.SignInAndUpHeader, {}); + } if (isSignUp === true) { return jsxRuntime.jsx(emailpasswordprebuiltui.SignUpHeader, { onClick: function () { @@ -141,7 +139,7 @@ var SignInAndUpTheme = function (props) { ((loginMethods === null || loginMethods === void 0 ? void 0 : loginMethods.thirdparty.enabled) && hasProviders); var emailPasswordEnabled = (props.emailPasswordRecipe !== undefined && usesDynamicLoginMethods === false) || - (loginMethods === null || loginMethods === void 0 ? void 0 : loginMethods.emailpassword.enabled); + (loginMethods === null || loginMethods === void 0 ? void 0 : loginMethods.emailpassword.enabled) === true; if (thirdPartyEnabled === false && emailPasswordEnabled === false) { return null; } @@ -157,16 +155,13 @@ var SignInAndUpTheme = function (props) { { "data-supertokens": "row" }, { children: [ - emailPasswordEnabled - ? jsxRuntime.jsx(Header, { - isSignUp: props.epState.isSignUp, - setIsSignUp: function (isSignUp) { - return props.epDispatch({ - type: isSignUp ? "setSignUp" : "setSignIn", - }); - }, - }) - : jsxRuntime.jsx(thirdpartyprebuiltui.SignInAndUpHeader, {}), + jsxRuntime.jsx(Header, { + isSignUp: props.epState.isSignUp, + setIsSignUp: function (isSignUp) { + return props.epDispatch({ type: isSignUp ? "setSignUp" : "setSignIn" }); + }, + emailPasswordEnabled: emailPasswordEnabled, + }), props.commonState.error && jsxRuntime.jsx(generalError.GeneralError, { error: props.commonState.error }), props.tpChildProps !== undefined && diff --git a/lib/ts/recipe/thirdpartyemailpassword/components/themes/signInAndUp/header.tsx b/lib/ts/recipe/thirdpartyemailpassword/components/themes/signInAndUp/header.tsx index 9de60a0f1..81a089f66 100644 --- a/lib/ts/recipe/thirdpartyemailpassword/components/themes/signInAndUp/header.tsx +++ b/lib/ts/recipe/thirdpartyemailpassword/components/themes/signInAndUp/header.tsx @@ -12,28 +12,26 @@ * License for the specific language governing permissions and limitations * under the License. */ -/* - * Imports. - */ import { withOverride } from "../../../../../components/componentOverride/withOverride"; import { SignInHeader } from "../../../../emailpassword/components/themes/signInAndUp/signInHeader"; import { SignUpHeader } from "../../../../emailpassword/components/themes/signInAndUp/signUpHeader"; +import { SignInAndUpHeader } from "../../../../thirdparty/components/themes/signInAndUp/signInAndUpHeader"; -/* - * Component. - */ export const Header = withOverride( "ThirdPartyEmailPasswordHeader", function ThirdPartyEmailPasswordHeader({ isSignUp, setIsSignUp, + emailPasswordEnabled, }: { + emailPasswordEnabled: boolean; isSignUp: boolean; setIsSignUp: (isSignUp: boolean) => void; }): JSX.Element { - /* - * Render. - */ + if (emailPasswordEnabled !== true) { + return ; + } + if (isSignUp === true) { return setIsSignUp(false)} />; } else { diff --git a/lib/ts/recipe/thirdpartyemailpassword/components/themes/signInAndUp/index.tsx b/lib/ts/recipe/thirdpartyemailpassword/components/themes/signInAndUp/index.tsx index 9a11fce80..b4aff5152 100644 --- a/lib/ts/recipe/thirdpartyemailpassword/components/themes/signInAndUp/index.tsx +++ b/lib/ts/recipe/thirdpartyemailpassword/components/themes/signInAndUp/index.tsx @@ -30,7 +30,6 @@ import { SignUpFooter } from "../../../../emailpassword/components/themes/signIn import { SignUpForm } from "../../../../emailpassword/components/themes/signInAndUp/signUpForm"; import { useDynamicLoginMethods } from "../../../../multitenancy/dynamicLoginMethodsContext"; import { ProvidersForm } from "../../../../thirdparty/components/themes/signInAndUp/providersForm"; -import { SignInAndUpHeader } from "../../../../thirdparty/components/themes/signInAndUp/signInAndUpHeader"; import { ThemeBase } from "../themeBase"; import { Header } from "./header"; @@ -54,7 +53,7 @@ const SignInAndUpTheme: React.FC = (usesDynamicLoginMethods === false && hasProviders) || (loginMethods?.thirdparty.enabled && hasProviders); const emailPasswordEnabled = (props.emailPasswordRecipe !== undefined && usesDynamicLoginMethods === false) || - loginMethods?.emailpassword.enabled; + loginMethods?.emailpassword.enabled === true; if (thirdPartyEnabled === false && emailPasswordEnabled === false) { return null; @@ -63,14 +62,11 @@ const SignInAndUpTheme: React.FC = return (
- {emailPasswordEnabled ? ( -
props.epDispatch({ type: isSignUp ? "setSignUp" : "setSignIn" })} - /> - ) : ( - - )} +
props.epDispatch({ type: isSignUp ? "setSignUp" : "setSignIn" })} + emailPasswordEnabled={emailPasswordEnabled} + /> {props.commonState.error && } {props.tpChildProps !== undefined && thirdPartyEnabled && ( From 9a7c5d022daf62a9e296c06c05b7bdf98cfa1ba4 Mon Sep 17 00:00:00 2001 From: rishabhpoddar Date: Wed, 6 Dec 2023 17:07:09 +0530 Subject: [PATCH 12/12] adding dev-v0.35.9 tag to this commit to ensure building --- docs/classes/index.default.html | 2 +- docs/classes/recipe_authRecipe.default.html | 2 +- docs/classes/recipe_emailpassword.default.html | 2 +- docs/classes/recipe_emailverification.default.html | 2 +- docs/classes/recipe_multitenancy.default.html | 2 +- docs/classes/recipe_passwordless.default.html | 2 +- docs/classes/recipe_recipeModule.default.html | 2 +- docs/classes/recipe_session.BooleanClaim.html | 2 +- docs/classes/recipe_session.PrimitiveArrayClaim.html | 2 +- docs/classes/recipe_session.PrimitiveClaim.html | 2 +- docs/classes/recipe_session.default.html | 2 +- docs/classes/recipe_thirdparty.ActiveDirectory.html | 2 +- docs/classes/recipe_thirdparty.Apple.html | 2 +- docs/classes/recipe_thirdparty.Bitbucket.html | 2 +- docs/classes/recipe_thirdparty.BoxySAML.html | 2 +- docs/classes/recipe_thirdparty.Discord.html | 2 +- docs/classes/recipe_thirdparty.Facebook.html | 2 +- docs/classes/recipe_thirdparty.Github.html | 2 +- docs/classes/recipe_thirdparty.Gitlab.html | 2 +- docs/classes/recipe_thirdparty.Google.html | 2 +- docs/classes/recipe_thirdparty.GoogleWorkspaces.html | 2 +- docs/classes/recipe_thirdparty.LinkedIn.html | 2 +- docs/classes/recipe_thirdparty.Okta.html | 2 +- docs/classes/recipe_thirdparty.Twitter.html | 2 +- docs/classes/recipe_thirdparty.default.html | 2 +- docs/classes/recipe_thirdpartyemailpassword.default.html | 2 +- docs/classes/recipe_thirdpartypasswordless.default.html | 2 +- docs/classes/recipe_userroles.default.html | 2 +- docs/modules/index.html | 2 +- docs/modules/recipe_emailpassword.html | 4 ++-- docs/modules/recipe_emailverification.html | 4 ++-- docs/modules/recipe_multitenancy.html | 2 +- docs/modules/recipe_passwordless.html | 4 ++-- docs/modules/recipe_session.html | 4 ++-- docs/modules/recipe_thirdparty.html | 4 ++-- docs/modules/recipe_thirdpartyemailpassword.html | 4 ++-- docs/modules/recipe_thirdpartypasswordless.html | 4 ++-- .../themes/resetPasswordUsingToken/submitNewPassword.d.ts | 2 +- .../components/themes/signInAndUp/signIn.d.ts | 4 ++-- .../components/themes/signInAndUp/signUp.d.ts | 7 ++++--- .../components/themes/translations.d.ts | 6 ------ .../components/themes/translations.d.ts | 5 ----- 42 files changed, 51 insertions(+), 61 deletions(-) diff --git a/docs/classes/index.default.html b/docs/classes/index.default.html index 8579c96fe..af7c02387 100644 --- a/docs/classes/index.default.html +++ b/docs/classes/index.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

SuperTokensWrapper: FC<PropsWithChildren<{ userContext?: any }>> = SuperTokensWrapper
useTranslation: (() => TranslationFunc) = useTranslation

Type declaration

    • (): TranslationFunc
    • Returns TranslationFunc

useUserContext: (() => any) = useUserContext

Type declaration

    • (): any
    • Returns any

Methods

  • changeLanguage(language: string): Promise<void>
  • init(config: SuperTokensConfig): void
  • loadTranslation(store: TranslationStore): void
  • redirectToAuth(options?: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }): Promise<void>
  • Parameters

    • Optional options: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }
      • Optional history?: any
      • Optional queryParams?: any
      • Optional redirectBack?: boolean
      • Optional show?: "signin" | "signup"

    Returns Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

SuperTokensWrapper: FC<PropsWithChildren<{ userContext?: any }>> = SuperTokensWrapper
useTranslation: (() => TranslationFunc) = useTranslation

Type declaration

    • (): TranslationFunc
    • Returns TranslationFunc

useUserContext: (() => any) = useUserContext

Type declaration

    • (): any
    • Returns any

Methods

  • changeLanguage(language: string): Promise<void>
  • init(config: SuperTokensConfig): void
  • loadTranslation(store: TranslationStore): void
  • redirectToAuth(options?: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }): Promise<void>
  • Parameters

    • Optional options: { history?: any; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup" }
      • Optional history?: any
      • Optional queryParams?: any
      • Optional redirectBack?: boolean
      • Optional show?: "signin" | "signup"

    Returns Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

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 170770c2d..ea94fa0f6 100644 --- a/docs/classes/recipe_authRecipe.default.html +++ b/docs/classes/recipe_authRecipe.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<T, Action, R, N> Abstract

Type Parameters

  • T

  • Action

  • R

  • N extends NormalisedConfig<T | GetRedirectionURLContext, Action, R | OnHandleEventContext>

Hierarchy

  • default<T | GetRedirectionURLContext, Action, R | OnHandleEventContext, N>
    • default

Index

Constructors

  • new default<T, Action, R, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<T, Action, R, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • doesSessionExist(input?: { userContext?: any }): Promise<boolean>
  • getAuthRecipeDefaultRedirectionURL(context: GetRedirectionURLContext): Promise<string>
  • getDefaultRedirectionURL(_: GetRedirectionURLContext | T): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>
  • signOut(input?: { userContext?: any }): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property
  • Inherited method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<T, Action, R, N> Abstract

Type Parameters

  • T

  • Action

  • R

  • N extends NormalisedConfig<T | GetRedirectionURLContext, Action, R | OnHandleEventContext>

Hierarchy

  • default<T | GetRedirectionURLContext, Action, R | OnHandleEventContext, N>
    • default

Index

Constructors

  • new default<T, Action, R, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<T, Action, R, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • doesSessionExist(input?: { userContext?: any }): Promise<boolean>
  • getAuthRecipeDefaultRedirectionURL(context: GetRedirectionURLContext): Promise<string>
  • getDefaultRedirectionURL(_: GetRedirectionURLContext | T): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>
  • signOut(input?: { userContext?: any }): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property
  • Inherited method

Settings

Theme

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 de330e935..3627cc970 100644 --- a/docs/classes/recipe_emailpassword.default.html +++ b/docs/classes/recipe_emailpassword.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
      • email: string
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

  • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

  • 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" }>
  • 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" }>

  • 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" }>
  • 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" }>

  • 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" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
      • email: string
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

  • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

  • 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" }>
  • 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" }>

  • 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" }>
  • 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" }>

  • 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" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

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 496345c57..9cec293c5 100644 --- a/docs/classes/recipe_emailverification.default.html +++ b/docs/classes/recipe_emailverification.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider
EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationRecipe.EmailVerificationClaim

Methods

  • getEmailVerificationTokenFromURL(input?: { userContext?: any }): string
  • isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>

  • sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>

  • verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider
EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationRecipe.EmailVerificationClaim

Methods

  • getEmailVerificationTokenFromURL(input?: { userContext?: any }): string
  • isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>

  • sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>

  • verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_multitenancy.default.html b/docs/classes/recipe_multitenancy.default.html index 3bc8e79a4..208dd41fd 100644 --- a/docs/classes/recipe_multitenancy.default.html +++ b/docs/classes/recipe_multitenancy.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

AllowedDomainsClaim: AllowedDomainsClaimClass = AllowedDomainsClaim
ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

AllowedDomainsClaim: AllowedDomainsClaimClass = AllowedDomainsClaim
ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_passwordless.default.html b/docs/classes/recipe_passwordless.default.html index 5339b9cde..f7d20ab49 100644 --- a/docs/classes/recipe_passwordless.default.html +++ b/docs/classes/recipe_passwordless.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; 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" }>

  • createCode(input: { email: string; options?: RecipeFunctionOptions; userContext?: any } | { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • 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" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

  • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
      • email: string
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

  • doesPhoneNumberExist(input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • phoneNumber: string
      • Optional userContext?: any

    Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

  • getLinkCodeFromURL(input?: { userContext?: any }): string
  • getLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input?: { userContext?: any }): Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties>
  • Type Parameters

    • CustomLoginAttemptInfoProperties

    Parameters

    • Optional input: { userContext?: any }
      • Optional userContext?: any

    Returns Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties>

  • getPreAuthSessionIdFromURL(input?: { userContext?: any }): string
  • resendCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>

  • setLoginAttemptInfo<CustomStateProperties>(input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }): Promise<void>
  • Type Parameters

    • CustomStateProperties

    Parameters

    • input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }
      • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties
      • Optional userContext?: any

    Returns Promise<void>

  • signOut(input?: { userContext?: any }): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; 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" }>

  • createCode(input: { email: string; options?: RecipeFunctionOptions; userContext?: any } | { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • 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" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

  • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
      • email: string
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

  • doesPhoneNumberExist(input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • phoneNumber: string
      • Optional userContext?: any

    Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

  • getLinkCodeFromURL(input?: { userContext?: any }): string
  • getLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input?: { userContext?: any }): Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties>
  • Type Parameters

    • CustomLoginAttemptInfoProperties

    Parameters

    • Optional input: { userContext?: any }
      • Optional userContext?: any

    Returns Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties>

  • getPreAuthSessionIdFromURL(input?: { userContext?: any }): string
  • resendCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>

  • setLoginAttemptInfo<CustomStateProperties>(input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }): Promise<void>
  • Type Parameters

    • CustomStateProperties

    Parameters

    • input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }
      • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties
      • Optional userContext?: any

    Returns Promise<void>

  • signOut(input?: { userContext?: any }): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_recipeModule.default.html b/docs/classes/recipe_recipeModule.default.html index 95d92f9af..74288375e 100644 --- a/docs/classes/recipe_recipeModule.default.html +++ b/docs/classes/recipe_recipeModule.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N> Abstract

Type Parameters

  • GetRedirectionURLContextType

  • Action

  • OnHandleEventContextType

  • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

Hierarchy

  • BaseRecipeModule<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Index

Constructors

  • new default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>
  • Type Parameters

    • GetRedirectionURLContextType

    • Action

    • OnHandleEventContextType

    • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

    Parameters

    • config: NormalisedConfigWithAppInfoAndRecipeID<N>

    Returns default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • getDefaultRedirectionURL(_: GetRedirectionURLContextType): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N> Abstract

Type Parameters

  • GetRedirectionURLContextType

  • Action

  • OnHandleEventContextType

  • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

Hierarchy

  • BaseRecipeModule<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Index

Constructors

  • new default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>
  • Type Parameters

    • GetRedirectionURLContextType

    • Action

    • OnHandleEventContextType

    • N extends NormalisedConfig<GetRedirectionURLContextType, Action, OnHandleEventContextType>

    Parameters

    • config: NormalisedConfigWithAppInfoAndRecipeID<N>

    Returns default<GetRedirectionURLContextType, Action, OnHandleEventContextType, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
recipeID: string

Methods

  • getDefaultRedirectionURL(_: GetRedirectionURLContextType): Promise<string>
  • getRedirectUrl(context: GetRedirectionURLContextType): Promise<string>
  • redirect(context: GetRedirectionURLContextType, history?: any, queryParams?: Record<string, string>): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_session.BooleanClaim.html b/docs/classes/recipe_session.BooleanClaim.html index 7222cbdd9..dbf0022f8 100644 --- a/docs/classes/recipe_session.BooleanClaim.html +++ b/docs/classes/recipe_session.BooleanClaim.html @@ -1,3 +1,3 @@ -BooleanClaim | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • BooleanClaim
    • BooleanClaim

Index

Constructors

  • new BooleanClaim(config: PrimitiveClaimConfig & { onFailureRedirection?: ValidationFailureCallback; showAccessDeniedOnFailure?: boolean }): BooleanClaim
  • Parameters

    • config: PrimitiveClaimConfig & { onFailureRedirection?: ValidationFailureCallback; showAccessDeniedOnFailure?: boolean }

    Returns BooleanClaim

Properties

defaultMaxAgeInSeconds: undefined | number
id: string
refresh: ((userContext: any) => Promise<void>)

Type declaration

UserInput: { override?: { functions?: any } } & RecipeModuleUserInput<any, PreAndPostAPIHookAction, any>

Variables

AllowedDomainsClaim: AllowedDomainsClaimClass
MultitenancyComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

Functions

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

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 diff --git a/docs/modules/recipe_passwordless.html b/docs/modules/recipe_passwordless.html index a9e752326..9127eaf9d 100644 --- a/docs/modules/recipe_passwordless.html +++ b/docs/modules/recipe_passwordless.html @@ -1,4 +1,4 @@ -recipe/passwordless | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

GetRedirectionURLContext: AuthRecipeModuleGetRedirectionURLContext
OnHandleEventContext: { action: "SUCCESS"; isNewRecipeUser: boolean; user: User } | { action: "PASSWORDLESS_RESTART_FLOW" } | { action: "PASSWORDLESS_CODE_SENT"; isResend: boolean } | AuthRecipeModuleOnHandleEventContext
PreAPIHookContext: { action: PreAndPostAPIHookAction; requestInit: RequestInit; url: string }

Type declaration

  • action: PreAndPostAPIHookAction
  • requestInit: RequestInit
  • url: string
RecipeInterface: { clearLoginAttemptInfo: any; consumeCode: any; createCode: any; doesEmailExist: any; doesPhoneNumberExist: any; getLinkCodeFromURL: any; getLoginAttemptInfo: any; getPreAuthSessionIdFromURL: any; getTenantIdFromURL: any; resendCode: any; setLoginAttemptInfo: any }

Type declaration

  • clearLoginAttemptInfo:function
    • clearLoginAttemptInfo(input: { userContext: any }): Promise<void>
    • +recipe/passwordless | supertokens-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Type Aliases

      GetRedirectionURLContext: AuthRecipeModuleGetRedirectionURLContext
      OnHandleEventContext: { action: "SUCCESS"; isNewRecipeUser: boolean; user: User } | { action: "PASSWORDLESS_RESTART_FLOW" } | { action: "PASSWORDLESS_CODE_SENT"; isResend: boolean } | AuthRecipeModuleOnHandleEventContext
      PreAPIHookContext: { action: PreAndPostAPIHookAction; requestInit: RequestInit; url: string }

      Type declaration

      • action: PreAndPostAPIHookAction
      • requestInit: RequestInit
      • url: string
      RecipeInterface: { clearLoginAttemptInfo: any; consumeCode: any; createCode: any; doesEmailExist: any; doesPhoneNumberExist: any; getLinkCodeFromURL: any; getLoginAttemptInfo: any; getPreAuthSessionIdFromURL: any; getTenantIdFromURL: any; resendCode: any; setLoginAttemptInfo: any }

      Type declaration

      • clearLoginAttemptInfo:function
        • clearLoginAttemptInfo(input: { userContext: any }): Promise<void>
        • Clear any information about login attempts from storage

          Parameters

          • input: { userContext: any }
            • userContext: any

          Returns Promise<void>

      • consumeCode:function
        • consumeCode(input: { deviceId: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any; userInputCode: string } | { linkCode: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
        • Log the user in using the input code or link code

          @@ -34,4 +34,4 @@

          Parameters

          • input: { deviceId: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any }
            • deviceId: string
            • Optional options?: RecipeFunctionOptions
            • preAuthSessionId: string
            • tenantId: string | undefined
            • userContext: any

          Returns Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>

          {status: "OK"} if succesful

      • setLoginAttemptInfo:function
        • setLoginAttemptInfo<CustomStateProperties>(input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomStateProperties; userContext: any }): Promise<void>
        • Set information about the current login attempt to storage

          -

          Type Parameters

          • CustomStateProperties

          Parameters

          • input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomStateProperties; userContext: any }
            • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomStateProperties
            • userContext: any

          Returns Promise<void>

      UserInput: ({ contactMethod: "EMAIL"; signInUpFeature?: SignInUpFeatureConfigInput; validateEmailAddress?: any } | { contactMethod: "PHONE"; signInUpFeature?: SignInUpFeatureConfigInput & { defaultCountry?: string }; validatePhoneNumber?: any } | { contactMethod: "EMAIL_OR_PHONE"; signInUpFeature?: SignInUpFeatureConfigInput & { defaultCountry?: string; guessInternationPhoneNumberFromInputPhoneNumber?: any }; validateEmailAddress?: any; validatePhoneNumber?: any }) & { linkClickedScreenFeature?: PasswordlessFeatureBaseConfig; override?: { functions?: any } } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

      Variables

      PasswordlessComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

      Functions

      • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
      • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • Optional input: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; 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" }>

      • createCode(input: { email: string; options?: RecipeFunctionOptions; userContext?: any } | { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • 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" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

      • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
      • Parameters

        • input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
          • email: string
          • Optional options?: RecipeFunctionOptions
          • Optional userContext?: any

        Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

      • doesPhoneNumberExist(input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
      • Parameters

        • input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }
          • Optional options?: RecipeFunctionOptions
          • phoneNumber: string
          • Optional userContext?: any

        Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

      • getLinkCodeFromURL(input?: { userContext?: any }): string
      • getLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input?: { userContext?: any }): Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties>
      • Type Parameters

        • CustomLoginAttemptInfoProperties

        Parameters

        • Optional input: { userContext?: any }
          • Optional userContext?: any

        Returns Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties>

      • getPreAuthSessionIdFromURL(input?: { userContext?: any }): string
      • resendCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
      • Parameters

        • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
          • Optional options?: RecipeFunctionOptions
          • Optional userContext?: any

        Returns Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>

      • setLoginAttemptInfo<CustomStateProperties>(input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }): Promise<void>
      • Type Parameters

        • CustomStateProperties

        Parameters

        • input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }
          • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties
          • Optional userContext?: any

        Returns Promise<void>

      • signOut(input?: { userContext?: any }): Promise<void>

      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: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomStateProperties; userContext: any }
        • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomStateProperties
        • userContext: any

      Returns Promise<void>

UserInput: ({ contactMethod: "EMAIL"; signInUpFeature?: SignInUpFeatureConfigInput; validateEmailAddress?: any } | { contactMethod: "PHONE"; signInUpFeature?: SignInUpFeatureConfigInput & { defaultCountry?: string }; validatePhoneNumber?: any } | { contactMethod: "EMAIL_OR_PHONE"; signInUpFeature?: SignInUpFeatureConfigInput & { defaultCountry?: string; guessInternationPhoneNumberFromInputPhoneNumber?: any }; validateEmailAddress?: any; validatePhoneNumber?: any }) & { linkClickedScreenFeature?: PasswordlessFeatureBaseConfig; override?: { functions?: any } } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

PasswordlessComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

Functions

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; 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" }>

  • createCode(input: { email: string; options?: RecipeFunctionOptions; userContext?: any } | { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • 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" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

  • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
      • email: string
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

  • doesPhoneNumberExist(input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • phoneNumber: string
      • Optional userContext?: any

    Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

  • getLinkCodeFromURL(input?: { userContext?: any }): string
  • getLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input?: { userContext?: any }): Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties>
  • Type Parameters

    • CustomLoginAttemptInfoProperties

    Parameters

    • Optional input: { userContext?: any }
      • Optional userContext?: any

    Returns Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties>

  • getPreAuthSessionIdFromURL(input?: { userContext?: any }): string
  • resendCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>

  • setLoginAttemptInfo<CustomStateProperties>(input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }): Promise<void>
  • Type Parameters

    • CustomStateProperties

    Parameters

    • input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }
      • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties
      • Optional userContext?: any

    Returns Promise<void>

  • signOut(input?: { userContext?: any }): Promise<void>

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 diff --git a/docs/modules/recipe_session.html b/docs/modules/recipe_session.html index 2dab2892a..c9ed17fa2 100644 --- a/docs/modules/recipe_session.html +++ b/docs/modules/recipe_session.html @@ -1,8 +1,8 @@ -recipe/session | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

ClaimValidationError: { reason?: any; validatorId: string }

Type declaration

  • Optional reason?: any
  • validatorId: string
ClaimValidationResult: { isValid: true } | { isValid: false; reason?: any }
InputType: WebJSInputType & { accessDeniedScreen?: SessionFeatureBaseConfig; style?: string; onHandleEvent?: any }
RecipeInterface: { addAxiosInterceptors: any; addFetchInterceptorsAndReturnModifiedFetch: any; addXMLHttpRequestInterceptor: any; doesSessionExist: any; getAccessTokenPayloadSecurely: any; getGlobalClaimValidators: any; getInvalidClaimsFromResponse: any; getUserId: any; shouldDoInterceptionBasedOnUrl: any; signOut: any; validateClaims: any }

Type declaration

  • addAxiosInterceptors:function
    • addAxiosInterceptors(input: { axiosInstance: any; userContext: any }): void
    • Parameters

      • input: { axiosInstance: any; userContext: any }
        • axiosInstance: any
        • userContext: any

      Returns void

  • addFetchInterceptorsAndReturnModifiedFetch:function
    • addFetchInterceptorsAndReturnModifiedFetch(input: { originalFetch: any; userContext: any }): ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)
    • Parameters

      • input: { originalFetch: any; userContext: any }
        • originalFetch: any
        • userContext: any

      Returns ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)

        • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
        • Parameters

          • input: URL | RequestInfo
          • Optional init: RequestInit

          Returns Promise<Response>

  • addXMLHttpRequestInterceptor:function
    • addXMLHttpRequestInterceptor(input: { userContext: any }): void
    • Parameters

      • input: { userContext: any }
        • userContext: any

      Returns void

  • doesSessionExist:function
    • doesSessionExist(input: { userContext: any }): Promise<boolean>
    • Parameters

      • input: { userContext: any }
        • userContext: any

      Returns Promise<boolean>

  • getAccessTokenPayloadSecurely:function
    • getAccessTokenPayloadSecurely(input: { userContext: any }): Promise<any>
    • Parameters

      • input: { userContext: any }
        • userContext: any

      Returns Promise<any>

  • getGlobalClaimValidators:function
  • getInvalidClaimsFromResponse:function
    • getInvalidClaimsFromResponse(input: { response: { data: any } | Response; userContext: any }): Promise<ClaimValidationError[]>
    • Parameters

      • input: { response: { data: any } | Response; userContext: any }
        • response: { data: any } | Response
        • userContext: any

      Returns Promise<ClaimValidationError[]>

  • getUserId:function
    • getUserId(input: { userContext: any }): Promise<string>
    • Parameters

      • input: { userContext: any }
        • userContext: any

      Returns Promise<string>

  • shouldDoInterceptionBasedOnUrl:function
    • shouldDoInterceptionBasedOnUrl(toCheckUrl: string, apiDomain: string, sessionTokenBackendDomain: undefined | string): boolean
    • Parameters

      • toCheckUrl: string
      • apiDomain: string
      • sessionTokenBackendDomain: undefined | string

      Returns boolean

  • signOut:function
    • signOut(input: { userContext: any }): Promise<void>
    • Parameters

      • input: { userContext: any }
        • userContext: any

      Returns Promise<void>

  • validateClaims:function
SessionClaim<ValueType>: { getLastFetchedTime: any; getValueFromPayload: any; refresh: any }

Type Parameters

  • ValueType

Type declaration

  • getLastFetchedTime:function
    • getLastFetchedTime(payload: any, _userContext?: any): undefined | number
    • Parameters

      • payload: any
      • Optional _userContext: any

      Returns undefined | number

  • getValueFromPayload:function
    • getValueFromPayload(payload: any, _userContext?: any): undefined | ValueType
    • Parameters

      • payload: any
      • Optional _userContext: any

      Returns undefined | ValueType

  • refresh:function
    • refresh(userContext: any): Promise<void>
    • Parameters

      • userContext: any

      Returns Promise<void>

SessionClaimValidator: { id: string; refresh: any; shouldRefresh: any; validate: any }

Type declaration

  • Readonly id: string
  • refresh:function
    • refresh(userContext: any): Promise<void>
    • +recipe/session | supertokens-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Type Aliases

      ClaimValidationError: { reason?: any; validatorId: string }

      Type declaration

      • Optional reason?: any
      • validatorId: string
      ClaimValidationResult: { isValid: true } | { isValid: false; reason?: any }
      InputType: WebJSInputType & { accessDeniedScreen?: SessionFeatureBaseConfig; style?: string; onHandleEvent?: any }
      RecipeInterface: { addAxiosInterceptors: any; addFetchInterceptorsAndReturnModifiedFetch: any; addXMLHttpRequestInterceptor: any; doesSessionExist: any; getAccessTokenPayloadSecurely: any; getGlobalClaimValidators: any; getInvalidClaimsFromResponse: any; getUserId: any; shouldDoInterceptionBasedOnUrl: any; signOut: any; validateClaims: any }

      Type declaration

      • addAxiosInterceptors:function
        • addAxiosInterceptors(input: { axiosInstance: any; userContext: any }): void
        • Parameters

          • input: { axiosInstance: any; userContext: any }
            • axiosInstance: any
            • userContext: any

          Returns void

      • addFetchInterceptorsAndReturnModifiedFetch:function
        • addFetchInterceptorsAndReturnModifiedFetch(input: { originalFetch: any; userContext: any }): ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)
        • Parameters

          • input: { originalFetch: any; userContext: any }
            • originalFetch: any
            • userContext: any

          Returns ((input: URL | RequestInfo, init?: RequestInit) => Promise<Response>)

            • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
            • Parameters

              • input: URL | RequestInfo
              • Optional init: RequestInit

              Returns Promise<Response>

      • addXMLHttpRequestInterceptor:function
        • addXMLHttpRequestInterceptor(input: { userContext: any }): void
        • Parameters

          • input: { userContext: any }
            • userContext: any

          Returns void

      • doesSessionExist:function
        • doesSessionExist(input: { userContext: any }): Promise<boolean>
        • Parameters

          • input: { userContext: any }
            • userContext: any

          Returns Promise<boolean>

      • getAccessTokenPayloadSecurely:function
        • getAccessTokenPayloadSecurely(input: { userContext: any }): Promise<any>
        • Parameters

          • input: { userContext: any }
            • userContext: any

          Returns Promise<any>

      • getGlobalClaimValidators:function
      • getInvalidClaimsFromResponse:function
        • getInvalidClaimsFromResponse(input: { response: { data: any } | Response; userContext: any }): Promise<ClaimValidationError[]>
        • Parameters

          • input: { response: { data: any } | Response; userContext: any }
            • response: { data: any } | Response
            • userContext: any

          Returns Promise<ClaimValidationError[]>

      • getUserId:function
        • getUserId(input: { userContext: any }): Promise<string>
        • Parameters

          • input: { userContext: any }
            • userContext: any

          Returns Promise<string>

      • shouldDoInterceptionBasedOnUrl:function
        • shouldDoInterceptionBasedOnUrl(toCheckUrl: string, apiDomain: string, sessionTokenBackendDomain: undefined | string): boolean
        • Parameters

          • toCheckUrl: string
          • apiDomain: string
          • sessionTokenBackendDomain: undefined | string

          Returns boolean

      • signOut:function
        • signOut(input: { userContext: any }): Promise<void>
        • Parameters

          • input: { userContext: any }
            • userContext: any

          Returns Promise<void>

      • validateClaims:function
      SessionClaim<ValueType>: { getLastFetchedTime: any; getValueFromPayload: any; refresh: any }

      Type Parameters

      • ValueType

      Type declaration

      • getLastFetchedTime:function
        • getLastFetchedTime(payload: any, _userContext?: any): undefined | number
        • Parameters

          • payload: any
          • Optional _userContext: any

          Returns undefined | number

      • getValueFromPayload:function
        • getValueFromPayload(payload: any, _userContext?: any): undefined | ValueType
        • Parameters

          • payload: any
          • Optional _userContext: any

          Returns undefined | ValueType

      • refresh:function
        • refresh(userContext: any): Promise<void>
        • Parameters

          • userContext: any

          Returns Promise<void>

      SessionClaimValidator: { id: string; refresh: any; shouldRefresh: any; validate: any }

      Type declaration

      • Readonly id: string
      • refresh:function
        • refresh(userContext: any): Promise<void>
        • Makes an API call that will refresh the claim in the token.

          Parameters

          • userContext: any

          Returns Promise<void>

      • shouldRefresh:function
        • shouldRefresh(accessTokenPayload: any, userContext: any): boolean | Promise<boolean>
        • Decides if we need to refresh the claim value before checking the payload with validate. E.g.: if the information in the payload is expired, or is not sufficient for this validator.

          Parameters

          • accessTokenPayload: any
          • userContext: any

          Returns boolean | Promise<boolean>

      • 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>

      SessionContextType: LoadedSessionContext | { loading: true }

      Variables

      SessionAuth: FC<PropsWithChildren<SessionAuthProps & { userContext?: any }>> = SessionAPIWrapper.SessionAuth
      SessionComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = SessionAPIWrapper.ComponentsOverrideProvider
      SessionContext: Context<{ accessDeniedValidatorError?: ClaimValidationError; invalidClaims: ClaimValidationError[]; loading: false } & SessionContextUpdate & { isDefault?: boolean } & { loading: true } & { isDefault?: boolean }> = ...

      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?: InputType): RecipeInitResult<unknown, unknown, unknown, any>
      • signOut(input?: { userContext?: any }): Promise<void>
      • useClaimValue<T>(claim: SessionClaim<T>): { loading: true } | { doesSessionExist: boolean; loading: false; value: undefined | T }

      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 +

      Parameters

      • accessTokenPayload: any
      • userContext: any

      Returns ClaimValidationResult | Promise<ClaimValidationResult>

SessionContextType: LoadedSessionContext | { loading: true }

Variables

SessionAuth: FC<PropsWithChildren<SessionAuthProps & { userContext?: any }>> = SessionAPIWrapper.SessionAuth
SessionComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = SessionAPIWrapper.ComponentsOverrideProvider
SessionContext: Context<{ accessDeniedValidatorError?: ClaimValidationError; invalidClaims: ClaimValidationError[]; loading: false } & SessionContextUpdate & { isDefault?: boolean } & { loading: true } & { isDefault?: boolean }> = ...

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?: InputType): RecipeInitResult<unknown, unknown, unknown, any>
  • signOut(input?: { userContext?: any }): Promise<void>
  • useClaimValue<T>(claim: SessionClaim<T>): { loading: true } | { doesSessionExist: boolean; loading: false; value: undefined | T }

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 diff --git a/docs/modules/recipe_thirdparty.html b/docs/modules/recipe_thirdparty.html index 27f6b5f19..b56ca5c04 100644 --- a/docs/modules/recipe_thirdparty.html +++ b/docs/modules/recipe_thirdparty.html @@ -1,4 +1,4 @@ -recipe/thirdparty | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

GetRedirectionURLContext: AuthRecipeModuleGetRedirectionURLContext
OnHandleEventContext: AuthRecipeModuleOnHandleEventContext | { action: "SUCCESS"; isNewRecipeUser: boolean; user: User; userContext: any }
PreAPIHookContext: { action: PreAndPostAPIHookAction; requestInit: RequestInit; url: string; userContext: any }

Type declaration

  • action: PreAndPostAPIHookAction
  • requestInit: RequestInit
  • url: string
  • userContext: any
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-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Type Aliases

      GetRedirectionURLContext: AuthRecipeModuleGetRedirectionURLContext
      OnHandleEventContext: AuthRecipeModuleOnHandleEventContext | { action: "SUCCESS"; isNewRecipeUser: boolean; user: User; userContext: any }
      PreAPIHookContext: { action: PreAndPostAPIHookAction; requestInit: RequestInit; url: string; userContext: any }

      Type declaration

      • action: PreAndPostAPIHookAction
      • requestInit: RequestInit
      • url: string
      • userContext: any
      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
        • @@ -26,4 +26,4 @@

          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

      • 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: { oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

      Variables

      ThirdpartyComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

      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
      • Type Parameters

        • CustomStateProperties

        Parameters

        • Optional input: { userContext?: any }
          • Optional userContext?: any

        Returns undefined | StateObject & CustomStateProperties

      • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
      • Parameters

        • input: { thirdPartyId: string; userContext?: any }
          • thirdPartyId: string
          • Optional userContext?: any

        Returns Promise<{ status: "OK" | "ERROR" }>

      • 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

        • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
          • Optional options?: RecipeFunctionOptions
          • Optional userContext?: any

        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>

UserInput: { oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

ThirdpartyComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

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
  • Type Parameters

    • CustomStateProperties

    Parameters

    • Optional input: { userContext?: any }
      • Optional userContext?: any

    Returns undefined | StateObject & CustomStateProperties

  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
  • Parameters

    • input: { thirdPartyId: string; userContext?: any }
      • thirdPartyId: string
      • Optional userContext?: any

    Returns Promise<{ status: "OK" | "ERROR" }>

  • 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

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    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 diff --git a/docs/modules/recipe_thirdpartyemailpassword.html b/docs/modules/recipe_thirdpartyemailpassword.html index ace8449e7..2a845c363 100644 --- a/docs/modules/recipe_thirdpartyemailpassword.html +++ b/docs/modules/recipe_thirdpartyemailpassword.html @@ -1,4 +1,4 @@ -recipe/thirdpartyemailpassword | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/thirdpartyemailpassword

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: { 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-auth-react
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Module recipe/thirdpartyemailpassword

      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: { 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" }>
        • Check if an 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}

          @@ -51,4 +51,4 @@

          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

      • 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: { disableEmailPassword?: boolean; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; resetPasswordUsingTokenFeature?: ResetPasswordUsingTokenUserInput; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

      Variables

      ThirdpartyEmailPasswordComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

      Functions

      • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
      • Parameters

        • input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
          • email: string
          • Optional options?: RecipeFunctionOptions
          • Optional userContext?: any

        Returns 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>
      • 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>

      • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
      • getStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
      • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
      • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "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" }>
      • Parameters

        • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
          • Optional options?: RecipeFunctionOptions
          • Optional userContext?: any

        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: { disableEmailPassword?: boolean; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any }; resetPasswordUsingTokenFeature?: ResetPasswordUsingTokenUserInput; signInAndUpFeature?: SignInAndUpFeatureUserInput } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

ThirdpartyEmailPasswordComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

Functions

  • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
      • email: string
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns 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>
  • 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>

  • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
  • getStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "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" | "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" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    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 diff --git a/docs/modules/recipe_thirdpartypasswordless.html b/docs/modules/recipe_thirdpartypasswordless.html index 14e0c8539..2e4578731 100644 --- a/docs/modules/recipe_thirdpartypasswordless.html +++ b/docs/modules/recipe_thirdpartypasswordless.html @@ -1,4 +1,4 @@ -recipe/thirdpartypasswordless | supertokens-auth-react
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>
    • +recipe/thirdpartypasswordless | supertokens-auth-react
      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

          @@ -62,4 +62,4 @@

          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; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any } } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

      Variables

      ThirdpartyPasswordlessComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

      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

        • Optional input: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; 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" }>

      • 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" }>
      • 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" }>

      • doesPasswordlessUserEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
      • Parameters

        • input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
          • email: string
          • Optional options?: RecipeFunctionOptions
          • Optional userContext?: any

        Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

      • doesPasswordlessUserPhoneNumberExist(input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
      • Parameters

        • input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }
          • Optional options?: RecipeFunctionOptions
          • phoneNumber: string
          • Optional userContext?: any

        Returns 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 } & CustomLoginAttemptInfoProperties>
      • Type Parameters

        • CustomLoginAttemptInfoProperties

        Parameters

        • Optional input: { userContext?: any }
          • Optional userContext?: any

        Returns Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties>

      • getPasswordlessPreAuthSessionIdFromURL(input?: { userContext?: any }): string
      • getThirdPartyAuthorisationURLWithQueryParamsAndSetState(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>

      • getThirdPartyStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
      • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
      • resendPasswordlessCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
      • Parameters

        • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
          • Optional options?: RecipeFunctionOptions
          • Optional userContext?: any

        Returns Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>

      • setPasswordlessLoginAttemptInfo<CustomStateProperties>(input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }): Promise<void>
      • Type Parameters

        • CustomStateProperties

        Parameters

        • input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }
          • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties
          • Optional userContext?: any

        Returns Promise<void>

      • signOut(input?: { userContext?: any }): Promise<void>
      • thirdPartySignInAndUp(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
          • Optional options?: RecipeFunctionOptions
          • Optional userContext?: any

        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: ({ 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; oAuthCallbackScreen?: FeatureBaseConfig; override?: { functions?: any } } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext>

Variables

ThirdpartyPasswordlessComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = Wrapper.ComponentsOverrideProvider

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

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; 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" }>

  • 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" }>
  • 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" }>

  • doesPasswordlessUserEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
      • email: string
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

  • doesPasswordlessUserPhoneNumberExist(input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • phoneNumber: string
      • Optional userContext?: any

    Returns 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 } & CustomLoginAttemptInfoProperties>
  • Type Parameters

    • CustomLoginAttemptInfoProperties

    Parameters

    • Optional input: { userContext?: any }
      • Optional userContext?: any

    Returns Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties>

  • getPasswordlessPreAuthSessionIdFromURL(input?: { userContext?: any }): string
  • getThirdPartyAuthorisationURLWithQueryParamsAndSetState(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>

  • getThirdPartyStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
  • resendPasswordlessCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>

  • setPasswordlessLoginAttemptInfo<CustomStateProperties>(input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }): Promise<void>
  • Type Parameters

    • CustomStateProperties

    Parameters

    • input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }
      • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties
      • Optional userContext?: any

    Returns Promise<void>

  • signOut(input?: { userContext?: any }): Promise<void>
  • thirdPartySignInAndUp(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    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 diff --git a/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts b/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts index 9c795dce2..b8ec36fd7 100644 --- a/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/resetPasswordUsingToken/submitNewPassword.d.ts @@ -1,7 +1,7 @@ /// export declare const SubmitNewPassword: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { - formFields: Omit[]; + formFields: import("../../../types").FormFieldThemeProps[]; error: string | undefined; } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; diff --git a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts index 64639bb96..46dd93ed6 100644 --- a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signIn.d.ts @@ -1,7 +1,7 @@ /// export declare const SignIn: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { - formFields: Omit[]; + formFields: import("../../../types").FormFieldThemeProps[]; error: string | undefined; } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; @@ -10,6 +10,6 @@ export declare const SignIn: import("react").ComponentType< config: import("../../../types").NormalisedConfig; signUpClicked?: (() => void) | undefined; forgotPasswordClick: () => void; - onSuccess: (result: { user: import("supertokens-web-js/types").User }) => void; + onSuccess: () => void; } >; diff --git a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts index 32bc386b1..1a0268aa8 100644 --- a/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts +++ b/lib/build/recipe/emailpassword/components/themes/signInAndUp/signUp.d.ts @@ -1,13 +1,14 @@ /// export declare const SignUp: import("react").ComponentType< import("../../../../../types").ThemeBaseProps & { + formFields: import("../../../types").FormFieldThemeProps[]; + error: string | undefined; + } & { recipeImplementation: import("supertokens-web-js/recipe/emailpassword").RecipeInterface; clearError: () => void; onError: (error: string) => void; config: import("../../../types").NormalisedConfig; signInClicked?: (() => void) | undefined; - onSuccess: (result: { user: import("supertokens-web-js/types").User }) => void; - formFields: import("../../../types").FormFieldThemeProps[]; - error: string | undefined; + onSuccess: () => void; } >; diff --git a/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts b/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts index 454ff978e..bb256d116 100644 --- a/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts +++ b/lib/build/recipe/thirdpartyemailpassword/components/themes/translations.d.ts @@ -58,9 +58,6 @@ export declare const defaultTranslationsThirdPartyEmailPassword: { "Password must contain at least one alphabet": undefined; "Password must contain at least one number": undefined; "Email is invalid": undefined; - "Reset password link was not created because of account take over risk. Please contact support. (ERR_CODE_001)": undefined; - "Cannot sign up due to security reasons. Please try logging in, use a different login method or contact support. (ERR_CODE_007)": undefined; - "Cannot sign in due to security reasons. Please try resetting your password, use a different login method or contact support. (ERR_CODE_008)": undefined; EMAIL_VERIFICATION_RESEND_SUCCESS: string; EMAIL_VERIFICATION_SEND_TITLE: string; EMAIL_VERIFICATION_SEND_DESC_START: string; @@ -89,8 +86,5 @@ export declare const defaultTranslationsThirdPartyEmailPassword: { THIRD_PARTY_PROVIDER_DEFAULT_BTN_START: string; THIRD_PARTY_PROVIDER_DEFAULT_BTN_END: string; THIRD_PARTY_ERROR_NO_EMAIL: string; - "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_004)": undefined; - "Cannot sign in / up because new email cannot be applied to existing account. Please contact support. (ERR_CODE_005)": undefined; - "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_006)": undefined; }; }; diff --git a/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts b/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts index b24b59e60..dbe4e941e 100644 --- a/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts +++ b/lib/build/recipe/thirdpartypasswordless/components/themes/translations.d.ts @@ -57,8 +57,6 @@ export declare const defaultTranslationsThirdPartyPasswordless: { "Failed to generate a one time code. Please try again": undefined; "Phone number is invalid": undefined; "Email is invalid": undefined; - "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_002)": undefined; - "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_003)": undefined; BRANDING_POWERED_BY_START: string; BRANDING_POWERED_BY_END: string; SOMETHING_WENT_WRONG_ERROR: string; @@ -71,8 +69,5 @@ export declare const defaultTranslationsThirdPartyPasswordless: { THIRD_PARTY_PROVIDER_DEFAULT_BTN_START: string; THIRD_PARTY_PROVIDER_DEFAULT_BTN_END: string; THIRD_PARTY_ERROR_NO_EMAIL: string; - "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_004)": undefined; - "Cannot sign in / up because new email cannot be applied to existing account. Please contact support. (ERR_CODE_005)": undefined; - "Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_006)": undefined; }; };