diff --git a/.version b/.version index 1f38bc0e..805579f3 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -v2.10.0 \ No newline at end of file +v2.11.0 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 76038178..2d9efbca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## [v2.11.0](https://github.com/auth0/auth0-react/tree/v2.11.0) (2025-12-11) +[Full Changelog](https://github.com/auth0/auth0-react/compare/v2.10.0...v2.11.0) + +**Added** +- chore: upgrade @auth0/auth0-spa-js to v2.11.0 [\#948](https://github.com/auth0/auth0-react/pull/948) ([yogeshchoudhary147](https://github.com/yogeshchoudhary147)) + ## [v2.10.0](https://github.com/auth0/auth0-react/tree/v2.10.0) (2025-12-05) [Full Changelog](https://github.com/auth0/auth0-react/compare/v2.9.0...v2.10.0) diff --git a/docs/classes/MfaRequiredError.html b/docs/classes/MfaRequiredError.html index 81e0015a..e3e4321a 100644 --- a/docs/classes/MfaRequiredError.html +++ b/docs/classes/MfaRequiredError.html @@ -1,5 +1,5 @@ MfaRequiredError | @auth0/auth0-react
@auth0/auth0-react
    Preparing search index...

    Class MfaRequiredError

    Error thrown when the token exchange results in a mfa_required error

    -

    Hierarchy (View Summary)

    Index

    Constructors

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • error: string
      • error_description: string
      • mfa_token: string

      Returns MfaRequiredError

    Properties

    error: string
    error_description: string
    message: string
    mfa_token: string
    name: string
    stack?: string
    prepareStackTrace?: (err: Error, stackTraces: CallSite[]) => any

    Optional override for formatting stack traces

    +

    Constructors

    • Parameters

      • error: string
      • error_description: string
      • mfa_token: string

      Returns MfaRequiredError

    Properties

    error: string
    error_description: string
    message: string
    mfa_token: string
    name: string
    stack?: string
    prepareStackTrace?: (err: Error, stackTraces: CallSite[]) => any

    Optional override for formatting stack traces

    stackTraceLimit: number

    Methods

    • Create .stack property on a target object

      Parameters

      • targetObject: object
      • OptionalconstructorOpt: Function

      Returns void

    • Parameters

      • __namedParameters: { error: string; error_description: string }

      Returns GenericError

    diff --git a/docs/classes/MissingRefreshTokenError.html b/docs/classes/MissingRefreshTokenError.html index 47571d3c..cc98e101 100644 --- a/docs/classes/MissingRefreshTokenError.html +++ b/docs/classes/MissingRefreshTokenError.html @@ -1,5 +1,5 @@ MissingRefreshTokenError | @auth0/auth0-react
    @auth0/auth0-react
      Preparing search index...

      Class MissingRefreshTokenError

      Error thrown when there is no refresh token to use

      -

      Hierarchy (View Summary)

      Index

      Constructors

      Hierarchy (View Summary)

      Index

      Constructors

      Properties

      audience: string
      error: string
      error_description: string
      message: string
      name: string
      scope: string
      stack?: string
      prepareStackTrace?: (err: Error, stackTraces: CallSite[]) => any

      Optional override for formatting stack traces

      +

      Constructors

      Properties

      audience: string
      error: string
      error_description: string
      message: string
      name: string
      scope: string
      stack?: string
      prepareStackTrace?: (err: Error, stackTraces: CallSite[]) => any

      Optional override for formatting stack traces

      stackTraceLimit: number

      Methods

      • Create .stack property on a target object

        Parameters

        • targetObject: object
        • OptionalconstructorOpt: Function

        Returns void

      • Parameters

        • __namedParameters: { error: string; error_description: string }

        Returns GenericError

      diff --git a/docs/classes/OAuthError.html b/docs/classes/OAuthError.html index a9915c39..a4549344 100644 --- a/docs/classes/OAuthError.html +++ b/docs/classes/OAuthError.html @@ -1,7 +1,7 @@ OAuthError | @auth0/auth0-react
      @auth0/auth0-react
        Preparing search index...

        Class OAuthError

        An OAuth2 error will come from the authorization server and will have at least an error property which will be the error code. And possibly an error_description property

        See: https://openid.net/specs/openid-connect-core-1_0.html#rfc.section.3.1.2.6

        -

        Hierarchy

        • Error
          • OAuthError
        Index

        Constructors

        Hierarchy

        • Error
          • OAuthError
        Index

        Constructors

        • Parameters

          • error: string
          • Optionalerror_description: string

          Returns OAuthError

        Properties

        error: string
        error_description?: string
        message: string
        name: string
        stack?: string
        prepareStackTrace?: (err: Error, stackTraces: CallSite[]) => any

        Optional override for formatting stack traces

        +

        Constructors

        • Parameters

          • error: string
          • Optionalerror_description: string

          Returns OAuthError

        Properties

        error: string
        error_description?: string
        message: string
        name: string
        stack?: string
        prepareStackTrace?: (err: Error, stackTraces: CallSite[]) => any

        Optional override for formatting stack traces

        stackTraceLimit: number

        Methods

        • Create .stack property on a target object

          Parameters

          • targetObject: object
          • OptionalconstructorOpt: Function

          Returns void

        diff --git a/docs/classes/UseDpopNonceError.html b/docs/classes/UseDpopNonceError.html index 6565da7f..9af63162 100644 --- a/docs/classes/UseDpopNonceError.html +++ b/docs/classes/UseDpopNonceError.html @@ -1,5 +1,5 @@ UseDpopNonceError | @auth0/auth0-react
        @auth0/auth0-react
          Preparing search index...

          Class UseDpopNonceError

          Error thrown when the wrong DPoP nonce is used and a potential subsequent retry wasn't able to fix it.

          -

          Hierarchy (View Summary)

          Index

          Constructors

          Hierarchy (View Summary)

          Index

          Constructors

          Properties

          error: string
          error_description: string
          message: string
          name: string
          newDpopNonce: undefined | string
          stack?: string
          prepareStackTrace?: (err: Error, stackTraces: CallSite[]) => any

          Optional override for formatting stack traces

          +

          Constructors

          Properties

          error: string
          error_description: string
          message: string
          name: string
          newDpopNonce: undefined | string
          stack?: string
          prepareStackTrace?: (err: Error, stackTraces: CallSite[]) => any

          Optional override for formatting stack traces

          stackTraceLimit: number

          Methods

          • Create .stack property on a target object

            Parameters

            • targetObject: object
            • OptionalconstructorOpt: Function

            Returns void

          • Parameters

            • __namedParameters: { error: string; error_description: string }

            Returns GenericError

          diff --git a/docs/functions/Auth0Provider.html b/docs/functions/Auth0Provider.html index 744fbdde..24e20cb5 100644 --- a/docs/functions/Auth0Provider.html +++ b/docs/functions/Auth0Provider.html @@ -2,4 +2,4 @@

          Provides the Auth0Context to its child components.

          -

          Type Parameters

          Parameters

          Returns Element

          +

          Type Parameters

          Parameters

          Returns Element

          diff --git a/docs/functions/useAuth0.html b/docs/functions/useAuth0.html index c35d2218..5e91b071 100644 --- a/docs/functions/useAuth0.html +++ b/docs/functions/useAuth0.html @@ -3,4 +3,4 @@

          Use the useAuth0 hook in your components to access the auth state and methods.

          TUser is an optional type param to provide a type to the user field.

          -

          Type Parameters

          Parameters

          Returns Auth0ContextInterface<TUser>

          +

          Type Parameters

          Parameters

          Returns Auth0ContextInterface<TUser>

          diff --git a/docs/functions/withAuth0.html b/docs/functions/withAuth0.html index f40bcdee..10345e06 100644 --- a/docs/functions/withAuth0.html +++ b/docs/functions/withAuth0.html @@ -4,4 +4,4 @@

          Wrap your class components in this Higher Order Component to give them access to the Auth0Context.

          Providing a context as the second argument allows you to configure the Auth0Provider the Auth0Context should come from f you have multiple within your application.

          -

          Type Parameters

          Parameters

          Returns ComponentType<Omit<P, "auth0">>

          +

          Type Parameters

          Parameters

          Returns ComponentType<Omit<P, "auth0">>

          diff --git a/docs/functions/withAuthenticationRequired.html b/docs/functions/withAuthenticationRequired.html index 73edf628..c02c057f 100644 --- a/docs/functions/withAuthenticationRequired.html +++ b/docs/functions/withAuthenticationRequired.html @@ -3,4 +3,4 @@

          When you wrap your components in this Higher Order Component and an anonymous user visits your component they will be redirected to the login page; after login they will be returned to the page they were redirected from.

          -

          Type Parameters

          Parameters

          Returns FC<P>

          +

          Type Parameters

          Parameters

          Returns FC<P>

          diff --git a/docs/interfaces/Auth0ContextInterface.html b/docs/interfaces/Auth0ContextInterface.html index eb6a967f..6d2c54d5 100644 --- a/docs/interfaces/Auth0ContextInterface.html +++ b/docs/interfaces/Auth0ContextInterface.html @@ -1,5 +1,5 @@ Auth0ContextInterface | @auth0/auth0-react
          @auth0/auth0-react
            Preparing search index...

            Interface Auth0ContextInterface<TUser>

            Contains the authenticated state and authentication methods provided by the useAuth0 hook.

            -
            interface Auth0ContextInterface<TUser extends User = User> {
                connectAccountWithRedirect: (
                    options: RedirectConnectAccountOptions,
                ) => Promise<void>;
                createFetcher: <TOutput extends CustomFetchMinimalOutput = Response>(
                    config?: FetcherConfig<TOutput>,
                ) => Fetcher<TOutput>;
                error: undefined | Error;
                exchangeToken: (
                    options: CustomTokenExchangeOptions,
                ) => Promise<TokenEndpointResponse>;
                generateDpopProof: (
                    params: {
                        accessToken: string;
                        method: string;
                        nonce?: string;
                        url: string;
                    },
                ) => Promise<string>;
                getAccessTokenSilently: {
                    (
                        options: GetTokenSilentlyOptions & { detailedResponse: true },
                    ): Promise<GetTokenSilentlyVerboseResponse>;
                    (options?: GetTokenSilentlyOptions): Promise<string>;
                    (
                        options: GetTokenSilentlyOptions,
                    ): Promise<string | GetTokenSilentlyVerboseResponse>;
                };
                getAccessTokenWithPopup: (
                    options?: GetTokenWithPopupOptions,
                    config?: PopupConfigOptions,
                ) => Promise<undefined | string>;
                getDpopNonce: (id?: string) => Promise<undefined | string>;
                getIdTokenClaims: () => Promise<undefined | IdToken>;
                handleRedirectCallback: (
                    url?: string,
                ) => Promise<ConnectAccountRedirectResult | RedirectLoginResult<any>>;
                isAuthenticated: boolean;
                isLoading: boolean;
                loginWithPopup: (
                    options?: PopupLoginOptions,
                    config?: PopupConfigOptions,
                ) => Promise<void>;
                loginWithRedirect: (
                    options?: RedirectLoginOptions<AppState>,
                ) => Promise<void>;
                logout: (options?: LogoutOptions) => Promise<void>;
                setDpopNonce: (nonce: string, id?: string) => Promise<void>;
                user: undefined | TUser;
            }

            Type Parameters

            Hierarchy

            • AuthState<TUser>
              • Auth0ContextInterface
            Index

            Properties

            interface Auth0ContextInterface<TUser extends User = User> {
                connectAccountWithRedirect: (
                    options: RedirectConnectAccountOptions,
                ) => Promise<void>;
                createFetcher: <TOutput extends CustomFetchMinimalOutput = Response>(
                    config?: FetcherConfig<TOutput>,
                ) => Fetcher<TOutput>;
                error: undefined | Error;
                exchangeToken: (
                    options: CustomTokenExchangeOptions,
                ) => Promise<TokenEndpointResponse>;
                generateDpopProof: (
                    params: {
                        accessToken: string;
                        method: string;
                        nonce?: string;
                        url: string;
                    },
                ) => Promise<string>;
                getAccessTokenSilently: {
                    (
                        options: GetTokenSilentlyOptions & { detailedResponse: true },
                    ): Promise<GetTokenSilentlyVerboseResponse>;
                    (options?: GetTokenSilentlyOptions): Promise<string>;
                    (
                        options: GetTokenSilentlyOptions,
                    ): Promise<string | GetTokenSilentlyVerboseResponse>;
                };
                getAccessTokenWithPopup: (
                    options?: GetTokenWithPopupOptions,
                    config?: PopupConfigOptions,
                ) => Promise<undefined | string>;
                getDpopNonce: (id?: string) => Promise<undefined | string>;
                getIdTokenClaims: () => Promise<undefined | IdToken>;
                handleRedirectCallback: (
                    url?: string,
                ) => Promise<ConnectAccountRedirectResult | RedirectLoginResult<any>>;
                isAuthenticated: boolean;
                isLoading: boolean;
                loginWithPopup: (
                    options?: PopupLoginOptions,
                    config?: PopupConfigOptions,
                ) => Promise<void>;
                loginWithRedirect: (
                    options?: RedirectLoginOptions<AppState>,
                ) => Promise<void>;
                logout: (options?: LogoutOptions) => Promise<void>;
                setDpopNonce: (nonce: string, id?: string) => Promise<void>;
                user: undefined | TUser;
            }

            Type Parameters

            Hierarchy

            • AuthState<TUser>
              • Auth0ContextInterface
            Index

            Properties

            connectAccountWithRedirect createFetcher error exchangeToken @@ -24,7 +24,7 @@ where the user can authenticate and authorize the account to be connected.

            If connecting the account is successful onRedirectCallback will be called with the details of the connected account.

            -
            createFetcher: <TOutput extends CustomFetchMinimalOutput = Response>(
                config?: FetcherConfig<TOutput>,
            ) => Fetcher<TOutput>

            Returns a new Fetcher class that will contain a fetchWithAuth() method. +

            createFetcher: <TOutput extends CustomFetchMinimalOutput = Response>(
                config?: FetcherConfig<TOutput>,
            ) => Fetcher<TOutput>

            Returns a new Fetcher class that will contain a fetchWithAuth() method. This is a drop-in replacement for the Fetch API's fetch() method, but will handle certain authentication logic for you, like building the proper auth headers or managing DPoP nonces and retries automatically.

            @@ -34,7 +34,7 @@ handle certain authentication logic for you, like building the proper auth headers or managing DPoP nonces and retries automatically.

            Check the EXAMPLES.md file for a deeper look into this method.

            -

            Type Parameters

            • TOutput extends CustomFetchMinimalOutput = Response

            Parameters

            Returns Fetcher<TOutput>

            error: undefined | Error
            exchangeToken: (
                options: CustomTokenExchangeOptions,
            ) => Promise<TokenEndpointResponse>
            const tokenResponse = await exchangeToken({
            subject_token: 'external_token_value',
            subject_token_type: 'urn:acme:legacy-system-token',
            scope: 'openid profile email'
            }); +

            Type Parameters

            • TOutput extends CustomFetchMinimalOutput = Response

            Parameters

            Returns Fetcher<TOutput>

            error: undefined | Error
            exchangeToken: (
                options: CustomTokenExchangeOptions,
            ) => Promise<TokenEndpointResponse>
            const tokenResponse = await exchangeToken({
            subject_token: 'external_token_value',
            subject_token_type: 'urn:acme:legacy-system-token',
            scope: 'openid profile email'
            });

            Exchanges an external subject token for Auth0 tokens via a token exchange request.

            @@ -51,13 +51,13 @@

            Type Declaration

            generateDpopProof: (
                params: {
                    accessToken: string;
                    method: string;
                    nonce?: string;
                    url: string;
                },
            ) => Promise<string>

            Returns a string to be used to demonstrate possession of the private +

            generateDpopProof: (
                params: {
                    accessToken: string;
                    method: string;
                    nonce?: string;
                    url: string;
                },
            ) => Promise<string>

            Returns a string to be used to demonstrate possession of the private key used to cryptographically bind access tokens with DPoP.

            It requires enabling the Auth0ClientOptions.useDpop option.

            Type Declaration

              • (
                    params: {
                        accessToken: string;
                        method: string;
                        nonce?: string;
                        url: string;
                    },
                ): Promise<string>
              • Returns a string to be used to demonstrate possession of the private key used to cryptographically bind access tokens with DPoP.

                It requires enabling the Auth0ClientOptions.useDpop option.

                -

                Parameters

                • params: { accessToken: string; method: string; nonce?: string; url: string }

                Returns Promise<string>

            getAccessTokenSilently: {
                (
                    options: GetTokenSilentlyOptions & { detailedResponse: true },
                ): Promise<GetTokenSilentlyVerboseResponse>;
                (options?: GetTokenSilentlyOptions): Promise<string>;
                (
                    options: GetTokenSilentlyOptions,
                ): Promise<string | GetTokenSilentlyVerboseResponse>;
            }
            const token = await getAccessTokenSilently(options);
            +

            Parameters

            • params: { accessToken: string; method: string; nonce?: string; url: string }

            Returns Promise<string>

            getAccessTokenSilently: {
                (
                    options: GetTokenSilentlyOptions & { detailedResponse: true },
                ): Promise<GetTokenSilentlyVerboseResponse>;
                (options?: GetTokenSilentlyOptions): Promise<string>;
                (
                    options: GetTokenSilentlyOptions,
                ): Promise<string | GetTokenSilentlyVerboseResponse>;
            }
            const token = await getAccessTokenSilently(options);
             

            If there's a valid token stored, return it. Otherwise, opens an @@ -76,7 +76,7 @@ back to using an iframe to make the token exchange.

            Note that in all cases, falling back to an iframe requires access to the auth0 cookie.

            -
            getAccessTokenWithPopup: (
                options?: GetTokenWithPopupOptions,
                config?: PopupConfigOptions,
            ) => Promise<undefined | string>
            const token = await getTokenWithPopup(options, config);
            +
            getAccessTokenWithPopup: (
                options?: GetTokenWithPopupOptions,
                config?: PopupConfigOptions,
            ) => Promise<undefined | string>
            const token = await getTokenWithPopup(options, config);
             

            Get an access token interactively.

            @@ -84,7 +84,7 @@ provided as arguments. Random and secure state and nonce parameters will be auto-generated. If the response is successful, results will be valid according to their expiration times.

            -
            getDpopNonce: (id?: string) => Promise<undefined | string>

            Returns the current DPoP nonce used for making requests to Auth0.

            +
            getDpopNonce: (id?: string) => Promise<undefined | string>

            Returns the current DPoP nonce used for making requests to Auth0.

            It can return undefined because when starting fresh it will not be populated until after the first response from the server.

            It requires enabling the Auth0ClientOptions.useDpop option.

            @@ -99,16 +99,16 @@

            The identifier of a nonce: if absent, it will get the nonce used for requests to Auth0. Otherwise, it will be used to select a specific non-Auth0 nonce.

            -
            getIdTokenClaims: () => Promise<undefined | IdToken>
            const claims = await getIdTokenClaims();
            +
            getIdTokenClaims: () => Promise<undefined | IdToken>
            const claims = await getIdTokenClaims();
             

            Returns all claims from the id_token if available.

            -
            handleRedirectCallback: (
                url?: string,
            ) => Promise<ConnectAccountRedirectResult | RedirectLoginResult<any>>

            After the browser redirects back to the callback page, +

            handleRedirectCallback: (
                url?: string,
            ) => Promise<ConnectAccountRedirectResult | RedirectLoginResult<any>>

            After the browser redirects back to the callback page, call handleRedirectCallback to handle success and error responses from Auth0. If the response is successful, results will be valid according to their expiration times.

            Type Declaration

            isAuthenticated: boolean
            isLoading: boolean
            loginWithPopup: (
                options?: PopupLoginOptions,
                config?: PopupConfigOptions,
            ) => Promise<void>
            await loginWithPopup(options, config);
            +

            Returns Promise<ConnectAccountRedirectResult | RedirectLoginResult<any>>

            isAuthenticated: boolean
            isLoading: boolean
            loginWithPopup: (
                options?: PopupLoginOptions,
                config?: PopupConfigOptions,
            ) => Promise<void>
            await loginWithPopup(options, config);
             

            Opens a popup with the /authorize URL using the parameters @@ -118,20 +118,20 @@

            IMPORTANT: This method has to be called from an event handler that was started by the user like a button click, for example, otherwise the popup will be blocked in most browsers.

            -
            loginWithRedirect: (options?: RedirectLoginOptions<AppState>) => Promise<void>
            await loginWithRedirect(options);
            +
            loginWithRedirect: (options?: RedirectLoginOptions<AppState>) => Promise<void>
            await loginWithRedirect(options);
             

            Performs a redirect to /authorize using the parameters provided as arguments. Random and secure state and nonce parameters will be auto-generated.

            -
            logout: (options?: LogoutOptions) => Promise<void>
            auth0.logout({ logoutParams: { returnTo: window.location.origin } });
            +
            logout: (options?: LogoutOptions) => Promise<void>
            auth0.logout({ logoutParams: { returnTo: window.location.origin } });
             

            Clears the application session and performs a redirect to /v2/logout, using the parameters provided as arguments, to clear the Auth0 session. If the logoutParams.federated option is specified, it also clears the Identity Provider session. Read more about how Logout works at Auth0.

            -
            setDpopNonce: (nonce: string, id?: string) => Promise<void>

            Sets the current DPoP nonce used for making requests to Auth0.

            +
            setDpopNonce: (nonce: string, id?: string) => Promise<void>

            Sets the current DPoP nonce used for making requests to Auth0.

            It requires enabling the Auth0ClientOptions.useDpop option.

            Type Declaration

            user: undefined | TUser
            +
            user: undefined | TUser
            diff --git a/docs/interfaces/Auth0ProviderOptions.html b/docs/interfaces/Auth0ProviderOptions.html index 6a370019..b3c48044 100644 --- a/docs/interfaces/Auth0ProviderOptions.html +++ b/docs/interfaces/Auth0ProviderOptions.html @@ -1,5 +1,5 @@ Auth0ProviderOptions | @auth0/auth0-react
            @auth0/auth0-react
              Preparing search index...

              Interface Auth0ProviderOptions<TUser>

              The main configuration to instantiate the Auth0Provider.

              -
              interface Auth0ProviderOptions<TUser extends User = User> {
                  auth0Client?: {
                      env?: { [key: string]: string };
                      name: string;
                      version: string;
                  };
                  authorizationParams?: ClientAuthorizationParams;
                  authorizeTimeoutInSeconds?: number;
                  cache?: ICache;
                  cacheLocation?: CacheLocation;
                  children?: ReactNode;
                  clientId: string;
                  context?: Context<Auth0ContextInterface<TUser>>;
                  cookieDomain?: string;
                  domain: string;
                  httpTimeoutInSeconds?: number;
                  issuer?: string;
                  leeway?: number;
                  legacySameSiteCookie?: boolean;
                  nowProvider?: () => number | Promise<number>;
                  onRedirectCallback?: (appState?: AppState, user?: TUser) => void;
                  sessionCheckExpiryDays?: number;
                  skipRedirectCallback?: boolean;
                  useCookiesForTransactions?: boolean;
                  useDpop?: boolean;
                  useFormData?: boolean;
                  useMrrt?: boolean;
                  useRefreshTokens?: boolean;
                  useRefreshTokensFallback?: boolean;
                  workerUrl?: string;
              }

              Type Parameters

              Hierarchy

              • Auth0ClientOptions
                • Auth0ProviderOptions
              Index

              Properties

              interface Auth0ProviderOptions<TUser extends User = User> {
                  auth0Client?: {
                      env?: { [key: string]: string };
                      name: string;
                      version: string;
                  };
                  authorizationParams?: ClientAuthorizationParams;
                  authorizeTimeoutInSeconds?: number;
                  cache?: ICache;
                  cacheLocation?: CacheLocation;
                  children?: ReactNode;
                  clientId: string;
                  context?: Context<Auth0ContextInterface<TUser>>;
                  cookieDomain?: string;
                  domain: string;
                  httpTimeoutInSeconds?: number;
                  issuer?: string;
                  leeway?: number;
                  legacySameSiteCookie?: boolean;
                  nowProvider?: () => number | Promise<number>;
                  onRedirectCallback?: (appState?: AppState, user?: TUser) => void;
                  sessionCheckExpiryDays?: number;
                  skipRedirectCallback?: boolean;
                  useCookiesForTransactions?: boolean;
                  useDpop?: boolean;
                  useFormData?: boolean;
                  useMrrt?: boolean;
                  useRefreshTokens?: boolean;
                  useRefreshTokensFallback?: boolean;
                  workerUrl?: string;
              }

              Type Parameters

              Hierarchy

              • Auth0ClientOptions
                • Auth0ProviderOptions
              Index

              Properties

              children?: ReactNode

              The child nodes your Provider has wrapped

              -
              clientId: string

              The Client ID found on your Application settings page

              +
              clientId: string

              The Client ID found on your Application settings page

              context?: Context<Auth0ContextInterface<TUser>>

              Context to be used when creating the Auth0Provider, defaults to the internally created context.

              This allows multiple Auth0Providers to be nested within the same application, the context value can then be passed to useAuth0, withAuth0, or withAuthenticationRequired to use that specific Auth0Provider to access @@ -48,7 +48,7 @@ used to store data is different

              For a sample on using multiple Auth0Providers review the React Account Linking Sample

              -
              cookieDomain?: string

              The domain the cookie is accessible from. If not set, the cookie is scoped to +

              cookieDomain?: string

              The domain the cookie is accessible from. If not set, the cookie is scoped to the current domain, including the subdomain.

              Note: setting this incorrectly may cause silent authentication to stop working on page load.

              @@ -73,7 +73,7 @@
              onRedirectCallback?: (appState?: AppState, user?: TUser) => void

              By default this removes the code and state parameters from the url when you are redirected from the authorize page. It uses window.history but you might want to overwrite this if you are using a custom router, like react-router-dom See the EXAMPLES.md for more info.

              -
              sessionCheckExpiryDays?: number

              Number of days until the cookie auth0.is.authenticated will expire +

              sessionCheckExpiryDays?: number

              Number of days until the cookie auth0.is.authenticated will expire Defaults to 1.

              skipRedirectCallback?: boolean

              By default, if the page url has code/state params, the SDK will treat them as Auth0's and attempt to exchange the code for a token. In some cases the code might be for something else (another OAuth SDK perhaps). In these @@ -81,7 +81,7 @@

              <Auth0Provider
              clientId={clientId}
              domain={domain}
              skipRedirectCallback={window.location.pathname === '/stripe-oauth-callback'}
              >
              -
              useCookiesForTransactions?: boolean

              If true, the SDK will use a cookie when storing information about the auth transaction while +

              useCookiesForTransactions?: boolean

              If true, the SDK will use a cookie when storing information about the auth transaction while the user is going through the authentication flow on the authorization server.

              The default is false, in which case the SDK will use session storage.

              You might want to enable this if you rely on your users being able to authenticate using flows that diff --git a/docs/interfaces/LogoutOptions.html b/docs/interfaces/LogoutOptions.html index c4c48fcf..7f85647e 100644 --- a/docs/interfaces/LogoutOptions.html +++ b/docs/interfaces/LogoutOptions.html @@ -1,4 +1,4 @@ -LogoutOptions | @auth0/auth0-react

              @auth0/auth0-react
                Preparing search index...

                Interface LogoutOptions

                interface LogoutOptions {
                    clientId?: null | string;
                    logoutParams?: {
                        federated?: boolean;
                        returnTo?: string;
                        [key: string]: any;
                    };
                    openUrl?: false
                    | ((url: string) => void | Promise<void>);
                }

                Hierarchy

                • Omit<SPALogoutOptions, "onRedirect">
                  • LogoutOptions
                Index

                Properties

                clientId? +LogoutOptions | @auth0/auth0-react
                @auth0/auth0-react
                  Preparing search index...

                  Interface LogoutOptions

                  interface LogoutOptions {
                      clientId?: null | string;
                      logoutParams?: {
                          federated?: boolean;
                          returnTo?: string;
                          [key: string]: any;
                      };
                      openUrl?: false
                      | ((url: string) => void | Promise<void>);
                  }

                  Hierarchy

                  • Omit<SPALogoutOptions, "onRedirect">
                    • LogoutOptions
                  Index

                  Properties

                  clientId?: null | string

                  The clientId of your application.

                  diff --git a/docs/interfaces/RedirectLoginOptions.html b/docs/interfaces/RedirectLoginOptions.html index 23d0e0f4..b8e0d3c2 100644 --- a/docs/interfaces/RedirectLoginOptions.html +++ b/docs/interfaces/RedirectLoginOptions.html @@ -1,4 +1,4 @@ -RedirectLoginOptions | @auth0/auth0-react
                  @auth0/auth0-react
                    Preparing search index...

                    Interface RedirectLoginOptions<TAppState>

                    interface RedirectLoginOptions<TAppState = AppState> {
                        appState?: TAppState;
                        authorizationParams?: AuthorizationParams;
                        fragment?: string;
                        openUrl?: (url: string) => void | Promise<void>;
                    }

                    Type Parameters

                    Hierarchy

                    • Omit<SPARedirectLoginOptions<TAppState>, "onRedirect">
                      • RedirectLoginOptions
                    Index

                    Properties

                    appState? +RedirectLoginOptions | @auth0/auth0-react
                    @auth0/auth0-react
                      Preparing search index...

                      Interface RedirectLoginOptions<TAppState>

                      interface RedirectLoginOptions<TAppState = AppState> {
                          appState?: TAppState;
                          authorizationParams?: AuthorizationParams;
                          fragment?: string;
                          openUrl?: (url: string) => void | Promise<void>;
                      }

                      Type Parameters

                      Hierarchy

                      • Omit<SPARedirectLoginOptions<TAppState>, "onRedirect">
                        • RedirectLoginOptions
                      Index

                      Properties

                      appState? authorizationParams? fragment? openUrl? diff --git a/docs/interfaces/WithAuth0Props.html b/docs/interfaces/WithAuth0Props.html index 57223af8..c2f45a67 100644 --- a/docs/interfaces/WithAuth0Props.html +++ b/docs/interfaces/WithAuth0Props.html @@ -1,3 +1,3 @@ WithAuth0Props | @auth0/auth0-react
                      @auth0/auth0-react
                        Preparing search index...

                        Interface WithAuth0Props

                        Components wrapped in withAuth0 will have an additional auth0 prop

                        -
                        interface WithAuth0Props {
                            auth0: Auth0ContextInterface;
                        }
                        Index

                        Properties

                        Properties

                        +
                        interface WithAuth0Props {
                            auth0: Auth0ContextInterface;
                        }
                        Index

                        Properties

                        Properties

                        diff --git a/docs/interfaces/WithAuthenticationRequiredOptions.html b/docs/interfaces/WithAuthenticationRequiredOptions.html index 3eaa4b79..be6cc116 100644 --- a/docs/interfaces/WithAuthenticationRequiredOptions.html +++ b/docs/interfaces/WithAuthenticationRequiredOptions.html @@ -1,5 +1,5 @@ WithAuthenticationRequiredOptions | @auth0/auth0-react
                        @auth0/auth0-react
                          Preparing search index...

                          Interface WithAuthenticationRequiredOptions

                          Options for the withAuthenticationRequired Higher Order Component

                          -
                          interface WithAuthenticationRequiredOptions {
                              context?: Context<Auth0ContextInterface<User>>;
                              loginOptions?: RedirectLoginOptions<AppState>;
                              onBeforeAuthentication?: () => Promise<void>;
                              onRedirecting?: () => Element;
                              returnTo?: string | (() => string);
                          }
                          Index

                          Properties

                          interface WithAuthenticationRequiredOptions {
                              context?: Context<Auth0ContextInterface<User>>;
                              loginOptions?: RedirectLoginOptions<AppState>;
                              onBeforeAuthentication?: () => Promise<void>;
                              onRedirecting?: () => Element;
                              returnTo?: string | (() => string);
                          }
                          Index

                          Properties

                          context?: Context<Auth0ContextInterface<User>>

                          The context to be used when calling useAuth0, this should only be provided if you are using multiple Auth0Providers within your application and you wish to tie a specific component to a Auth0Provider other than the Auth0Provider associated with the default Auth0Context.

                          -
                          withAuthenticationRequired(Profile, {
                          loginOptions: {
                          appState: {
                          customProp: 'foo'
                          }
                          }
                          }) +
                          withAuthenticationRequired(Profile, {
                          loginOptions: {
                          appState: {
                          customProp: 'foo'
                          }
                          }
                          })

                          Pass additional login options, like extra appState to the login page. This will be merged with the returnTo option used by the onRedirectCallback handler.

                          -
                          onBeforeAuthentication?: () => Promise<void>
                          withAuthenticationRequired(Profile, {
                          onBeforeAuthentication: () => { analyticsLibrary.track('login_triggered'); }
                          }) +
                          onBeforeAuthentication?: () => Promise<void>
                          withAuthenticationRequired(Profile, {
                          onBeforeAuthentication: () => { analyticsLibrary.track('login_triggered'); }
                          })

                          Allows executing logic before the user is redirected to the login page.

                          -
                          onRedirecting?: () => Element
                          withAuthenticationRequired(Profile, {
                          onRedirecting: () => <div>Redirecting you to the login...</div>
                          }) +
                          onRedirecting?: () => Element
                          withAuthenticationRequired(Profile, {
                          onRedirecting: () => <div>Redirecting you to the login...</div>
                          })

                          Render a message to show that the user is being redirected to the login.

                          -
                          returnTo?: string | (() => string)
                          withAuthenticationRequired(Profile, {
                          returnTo: '/profile'
                          }) +
                          returnTo?: string | (() => string)
                          withAuthenticationRequired(Profile, {
                          returnTo: '/profile'
                          })

                          or

                          @@ -28,4 +28,4 @@

                          Add a path for the onRedirectCallback handler to return the user to after login.

                          -
                          +
                          diff --git a/docs/types/AppState.html b/docs/types/AppState.html index 9aa71afd..88b8678d 100644 --- a/docs/types/AppState.html +++ b/docs/types/AppState.html @@ -1,6 +1,6 @@ AppState | @auth0/auth0-react
                          @auth0/auth0-react
                            Preparing search index...

                            Type Alias AppState

                            The state of the application before the user was redirected to the login page and any account that the user may have connected to.

                            -
                            type AppState = {
                                connectedAccount?: ConnectedAccount;
                                response_type?: ResponseType;
                                returnTo?: string;
                                [key: string]: any;
                            }

                            Indexable

                            • [key: string]: any
                            Index

                            Properties

                            type AppState = {
                                connectedAccount?: ConnectedAccount;
                                response_type?: ResponseType;
                                returnTo?: string;
                                [key: string]: any;
                            }

                            Indexable

                            • [key: string]: any
                            Index

                            Properties

                            connectedAccount?: ConnectedAccount
                            response_type?: ResponseType
                            returnTo?: string
                            +

                            Properties

                            connectedAccount?: ConnectedAccount
                            response_type?: ResponseType
                            returnTo?: string
                            diff --git a/docs/types/ConnectedAccount.html b/docs/types/ConnectedAccount.html index b93917dd..b947e850 100644 --- a/docs/types/ConnectedAccount.html +++ b/docs/types/ConnectedAccount.html @@ -1,2 +1,2 @@ ConnectedAccount | @auth0/auth0-react
                            @auth0/auth0-react
                              Preparing search index...

                              Type Alias ConnectedAccount

                              ConnectedAccount: Omit<
                                  ConnectAccountRedirectResult,
                                  "appState"
                                  | "response_type",
                              >

                              The account that has been connected during the connect flow.

                              -
                              +
                              diff --git a/docs/types/CustomTokenExchangeOptions.html b/docs/types/CustomTokenExchangeOptions.html index fc5ca314..e9ca84e7 100644 --- a/docs/types/CustomTokenExchangeOptions.html +++ b/docs/types/CustomTokenExchangeOptions.html @@ -1,12 +1,13 @@ CustomTokenExchangeOptions | @auth0/auth0-react
                              @auth0/auth0-react
                                Preparing search index...

                                Type Alias CustomTokenExchangeOptions

                                Represents the configuration options required for initiating a Custom Token Exchange request following RFC 8693 specifications.

                                type CustomTokenExchangeOptions = {
                                    audience?: string;
                                    scope?: string;
                                    subject_token: string;
                                    subject_token_type: string;
                                    [key: string]: unknown;
                                }

                                Indexable

                                • [key: string]: unknown

                                  Additional custom parameters for Auth0 Action processing

                                  +
                                type CustomTokenExchangeOptions = {
                                    audience?: string;
                                    organization?: string;
                                    scope?: string;
                                    subject_token: string;
                                    subject_token_type: string;
                                    [key: string]: unknown;
                                }

                                Indexable

                                • [key: string]: unknown

                                  Additional custom parameters for Auth0 Action processing

                                  Accessible in Action code via event.request.body

                                  {
                                  custom_parameter: "session_context",
                                  device_fingerprint: "a3d8f7...",
                                  }
                                Index

                                Properties

                                "https://api.your-service.com/v1"
                                 
                                -
                                scope?: string

                                Space-separated list of OAuth 2.0 scopes being requested

                                +
                                organization?: string

                                ID or name of the organization to use when authenticating a user. +When provided, the user will be authenticated using the organization context. +The organization ID will be present in the access token payload.

                                +
                                scope?: string

                                Space-separated list of OAuth 2.0 scopes being requested

                                Subject to API authorization policies configured in Auth0

                                "openid profile email read:data write:data"
                                 
                                @@ -44,4 +48,4 @@
                                "urn:acme:legacy-system-token"
                                "https://api.yourcompany.com/token-type/v1"
                                -
                                +
                                diff --git a/docs/variables/Auth0Context.html b/docs/variables/Auth0Context.html index bed1373c..956d966f 100644 --- a/docs/variables/Auth0Context.html +++ b/docs/variables/Auth0Context.html @@ -1,2 +1,2 @@ Auth0Context | @auth0/auth0-react
                                @auth0/auth0-react
                                  Preparing search index...

                                  Variable Auth0ContextConst

                                  Auth0Context: Context<Auth0ContextInterface<User>> = ...

                                  The Auth0 Context

                                  -
                                  +
                                  diff --git a/package-lock.json b/package-lock.json index 64469309..7d6487e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@auth0/auth0-react", - "version": "2.10.0", + "version": "2.11.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@auth0/auth0-react", - "version": "2.10.0", + "version": "2.11.0", "license": "MIT", "dependencies": { "@auth0/auth0-spa-js": "^2.11.0" diff --git a/package.json b/package.json index 5e908f98..b2307b52 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "author": "Auth0", "name": "@auth0/auth0-react", - "version": "2.10.0", + "version": "2.11.0", "description": "Auth0 SDK for React Single Page Applications (SPA)", "keywords": [ "auth0",