diff --git a/.version b/.version index a6316f06..fa49670c 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -v2.3.0 \ No newline at end of file +v2.4.0 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b11d7e9..90c5bd11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## [v2.4.0](https://github.com/auth0/auth0-react/tree/v2.4.0) (2025-07-22) +[Full Changelog](https://github.com/auth0/auth0-react/compare/v2.3.0...v2.4.0) + +**Added** +- Bump @auth0/auth0-spa-js from 2.2.0 to 2.3.0 [\#858](https://github.com/auth0/auth0-react/pull/858) ([dependabot[bot]](https://github.com/apps/dependabot)) + +**Fixed** +- Enhance type safety in Auth0Provider and reducer by introducing generic user type [\#842](https://github.com/auth0/auth0-react/pull/842) ([gyaneshgouraw-okta](https://github.com/gyaneshgouraw-okta)) + ## [v2.3.0](https://github.com/auth0/auth0-react/tree/v2.3.0) (2025-01-21) [Full Changelog](https://github.com/auth0/auth0-react/compare/v2.2.4...v2.3.0) diff --git a/docs/classes/OAuthError.html b/docs/classes/OAuthError.html index 205b8476..fe1a0248 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/User.html b/docs/classes/User.html index 6365885c..16662013 100644 --- a/docs/classes/User.html +++ b/docs/classes/User.html @@ -1,4 +1,4 @@ -User | @auth0/auth0-react
    @auth0/auth0-react
      Preparing search index...

      Class User

      Indexable

      • [key: string]: any
      Index

      Constructors

      constructor +User | @auth0/auth0-react
      @auth0/auth0-react
        Preparing search index...

        Class User

        Indexable

        • [key: string]: any
        Index

        Constructors

        Properties

        Constructors

        Properties

        address?: string
        birthdate?: string
        email?: string
        email_verified?: boolean
        family_name?: string
        gender?: string
        given_name?: string
        locale?: string
        middle_name?: string
        name?: string
        nickname?: string
        phone_number?: string
        phone_number_verified?: boolean
        picture?: string
        preferred_username?: string
        profile?: string
        sub?: string
        updated_at?: string
        website?: string
        zoneinfo?: string
        +

        Constructors

        Properties

        address?: string
        birthdate?: string
        email?: string
        email_verified?: boolean
        family_name?: string
        gender?: string
        given_name?: string
        locale?: string
        middle_name?: string
        name?: string
        nickname?: string
        phone_number?: string
        phone_number_verified?: boolean
        picture?: string
        preferred_username?: string
        profile?: string
        sub?: string
        updated_at?: string
        website?: string
        zoneinfo?: string
        diff --git a/docs/functions/Auth0Provider.html b/docs/functions/Auth0Provider.html index 93ba6587..5a8a8a51 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 1c763cec..aab84b23 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 5da1eebf..9a94a284 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 8e7c4ddf..87ffb39f 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 f7aab4cf..8e81cbba 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> {
              error: undefined | Error;
              getAccessTokenSilently: {
                  (
                      options: GetTokenSilentlyOptions & { detailedResponse: true },
                  ): Promise<GetTokenSilentlyVerboseResponse>;
                  (options?: GetTokenSilentlyOptions): Promise<string>;
                  (
                      options: GetTokenSilentlyOptions,
                  ): Promise<string | GetTokenSilentlyVerboseResponse>;
              };
              getAccessTokenWithPopup: (
                  options?: GetTokenWithPopupOptions,
                  config?: PopupConfigOptions,
              ) => Promise<undefined | string>;
              getIdTokenClaims: () => Promise<undefined | IdToken>;
              handleRedirectCallback: (url?: string) => Promise<RedirectLoginResult<any>>;
              isAuthenticated: boolean;
              isLoading: boolean;
              loginWithPopup: (
                  options?: PopupLoginOptions,
                  config?: PopupConfigOptions,
              ) => Promise<void>;
              loginWithRedirect: (
                  options?: RedirectLoginOptions<AppState>,
              ) => Promise<void>;
              logout: (options?: LogoutOptions) => Promise<void>;
              user: undefined | TUser;
          }

          Type Parameters

          Hierarchy

          • AuthState<TUser>
            • Auth0ContextInterface
          Index

          Properties

          interface Auth0ContextInterface<TUser extends User = User> {
              error: undefined | Error;
              getAccessTokenSilently: {
                  (
                      options: GetTokenSilentlyOptions & { detailedResponse: true },
                  ): Promise<GetTokenSilentlyVerboseResponse>;
                  (options?: GetTokenSilentlyOptions): Promise<string>;
                  (
                      options: GetTokenSilentlyOptions,
                  ): Promise<string | GetTokenSilentlyVerboseResponse>;
              };
              getAccessTokenWithPopup: (
                  options?: GetTokenWithPopupOptions,
                  config?: PopupConfigOptions,
              ) => Promise<undefined | string>;
              getIdTokenClaims: () => Promise<undefined | IdToken>;
              handleRedirectCallback: (url?: string) => Promise<RedirectLoginResult<any>>;
              isAuthenticated: boolean;
              isLoading: boolean;
              loginWithPopup: (
                  options?: PopupLoginOptions,
                  config?: PopupConfigOptions,
              ) => Promise<void>;
              loginWithRedirect: (
                  options?: RedirectLoginOptions<AppState>,
              ) => Promise<void>;
              logout: (options?: LogoutOptions) => Promise<void>;
              user: undefined | TUser;
          }

          Type Parameters

          Hierarchy

          • AuthState<TUser>
            • Auth0ContextInterface
          Index

          Properties

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

          Properties

          error: undefined | Error
          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 @@ -29,7 +29,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.

          @@ -37,16 +37,16 @@ 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.

          -
          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<RedirectLoginResult<any>>

          After the browser redirects back to the callback page, +

          handleRedirectCallback: (url?: string) => Promise<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

            • (url?: string): Promise<RedirectLoginResult<any>>
            • Parameters

              • Optionalurl: string

                The URL to that should be used to retrieve the state and code values. Defaults to window.location.href if not given.

                -

              Returns Promise<RedirectLoginResult<any>>

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

          Returns Promise<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 @@ -56,17 +56,17 @@

          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.

          -
          user: undefined | TUser
          +
          user: undefined | TUser
          diff --git a/docs/interfaces/Auth0ProviderOptions.html b/docs/interfaces/Auth0ProviderOptions.html index 69a44925..b20023ce 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?: AuthorizationParams;
                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;
                useFormData?: 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?: AuthorizationParams;
                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;
                useFormData?: boolean;
                useRefreshTokens?: boolean;
                useRefreshTokensFallback?: boolean;
                workerUrl?: string;
            }

            Type Parameters

            Hierarchy

            • Auth0ClientOptions
              • Auth0ProviderOptions
            Index

            Properties

            auth0Client?: { env?: { [key: string]: string }; name: string; version: string }

            Internal property to send information about the client to the authorization server.

            -
            authorizationParams?: AuthorizationParams

            URL parameters that will be sent back to the Authorization Server. This can be known parameters +

            authorizationParams?: AuthorizationParams

            URL parameters that will be sent back to the Authorization Server. This can be known parameters defined by Auth0 or custom parameters that you define.

            -
            authorizeTimeoutInSeconds?: number

            A maximum number of seconds to wait before declaring background calls to /authorize as failed for timeout +

            authorizeTimeoutInSeconds?: number

            A maximum number of seconds to wait before declaring background calls to /authorize as failed for timeout Defaults to 60s.

            -
            cache?: ICache

            Specify a custom cache implementation to use for token storage and retrieval. This setting takes precedence over cacheLocation if they are both specified.

            -
            cacheLocation?: CacheLocation

            The location to use when storing cache data. Valid values are memory or localstorage. +

            cache?: ICache

            Specify a custom cache implementation to use for token storage and retrieval. This setting takes precedence over cacheLocation if they are both specified.

            +
            cacheLocation?: CacheLocation

            The location to use when storing cache data. Valid values are memory or localstorage. The default setting is memory.

            Read more about changing storage options in the Auth0 docs

            -
            children?: ReactNode

            The child nodes your Provider has wrapped

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

            +
            children?: ReactNode

            The child nodes your Provider has wrapped

            +
            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 auth state and methods specifically tied to the provider that the context belongs to.

            @@ -46,51 +46,51 @@ 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.

            To keep a user logged in across multiple subdomains set this to your top-level domain and prefixed with a . (eg: .example.com).

            -
            domain: string

            Your Auth0 account domain such as 'example.auth0.com', +

            domain: string

            Your Auth0 account domain such as 'example.auth0.com', 'example.eu.auth0.com' or , 'example.mycompany.com' (when using custom domains)

            -
            httpTimeoutInSeconds?: number

            Specify the timeout for HTTP calls using fetch. The default is 10 seconds.

            -
            issuer?: string

            The issuer to be used for validation of JWTs, optionally defaults to the domain above

            -
            leeway?: number

            The value in seconds used to account for clock skew in JWT expirations. +

            httpTimeoutInSeconds?: number

            Specify the timeout for HTTP calls using fetch. The default is 10 seconds.

            +
            issuer?: string

            The issuer to be used for validation of JWTs, optionally defaults to the domain above

            +
            leeway?: number

            The value in seconds used to account for clock skew in JWT expirations. Typically, this value is no more than a minute or two at maximum. Defaults to 60s.

            -
            legacySameSiteCookie?: boolean

            Sets an additional cookie with no SameSite attribute to support legacy browsers +

            legacySameSiteCookie?: boolean

            Sets an additional cookie with no SameSite attribute to support legacy browsers that are not compatible with the latest SameSite changes. This will log a warning on modern browsers, you can disable the warning by setting this to false but be aware that some older useragents will not work, See https://www.chromium.org/updates/same-site/incompatible-clients Defaults to true

            -
            nowProvider?: () => number | Promise<number>

            Modify the value used as the current time during the token validation.

            +
            nowProvider?: () => number | Promise<number>

            Modify the value used as the current time during the token validation.

            Note: Using this improperly can potentially compromise the token validation.

            -
            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. +

            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 +

            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 instances you can instruct the client to ignore them eg

            <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 may end up spanning across multiple tabs (e.g. magic links) or you cannot otherwise rely on session storage being available.

            -
            useFormData?: boolean

            If true, data to the token endpoint is transmitted as x-www-form-urlencoded data, if false it will be transmitted as JSON. The default setting is true.

            +
            useFormData?: boolean

            If true, data to the token endpoint is transmitted as x-www-form-urlencoded data, if false it will be transmitted as JSON. The default setting is true.

            Note: Setting this to false may affect you if you use Auth0 Rules and are sending custom, non-primitive data. If you disable this, please verify that your Auth0 Rules continue to work as intended.

            -
            useRefreshTokens?: boolean

            If true, refresh tokens are used to fetch new access tokens from the Auth0 server. If false, the legacy technique of using a hidden iframe and the authorization_code grant with prompt=none is used. +

            useRefreshTokens?: boolean

            If true, refresh tokens are used to fetch new access tokens from the Auth0 server. If false, the legacy technique of using a hidden iframe and the authorization_code grant with prompt=none is used. The default setting is false.

            Note: Use of refresh tokens must be enabled by an administrator on your Auth0 client application.

            -
            useRefreshTokensFallback?: boolean

            If true, fallback to the technique of using a hidden iframe and the authorization_code grant with prompt=none when unable to use refresh tokens. If false, the iframe fallback is not used and +

            useRefreshTokensFallback?: boolean

            If true, fallback to the technique of using a hidden iframe and the authorization_code grant with prompt=none when unable to use refresh tokens. If false, the iframe fallback is not used and errors relating to a failed refresh_token grant should be handled appropriately. The default setting is false.

            Note: There might be situations where doing silent auth with a Web Message response from an iframe is not possible, like when you're serving your application from the file system or a custom protocol (like in a Desktop or Native app). @@ -99,9 +99,9 @@

            let token: string;
            try {
            token = await auth0.getTokenSilently();
            } catch (e) {
            if (e.error === 'missing_refresh_token' || e.error === 'invalid_grant') {
            auth0.loginWithRedirect();
            }
            }
            -
            workerUrl?: string

            If provided, the SDK will load the token worker from this URL instead of the integrated blob. An example of when this is useful is if you have strict +

            workerUrl?: string

            If provided, the SDK will load the token worker from this URL instead of the integrated blob. An example of when this is useful is if you have strict Content-Security-Policy (CSP) and wish to avoid needing to set worker-src: blob:. We recommend either serving the worker, which you can find in the module at <module_path>/dist/auth0-spa-js.worker.production.js, from the same host as your application or using the Auth0 CDN https://cdn.auth0.com/js/auth0-spa-js/<version>/auth0-spa-js.worker.production.js.

            Note: The worker is only used when useRefreshTokens: true, cacheLocation: 'memory', and the cache is not custom.

            -
            +
            diff --git a/docs/interfaces/AuthorizationParams.html b/docs/interfaces/AuthorizationParams.html index d352f201..a40c5611 100644 --- a/docs/interfaces/AuthorizationParams.html +++ b/docs/interfaces/AuthorizationParams.html @@ -26,7 +26,7 @@
            id_token_hint?: string

            Previously issued ID Token.

            invitation?: string

            The Id of an invitation to accept. This is available from the user invitation URL that is given when participating in a user invitation flow.

            -
            login_hint?: string

            The user's email address or other identifier. When your app knows +

            login_hint?: string

            The user's email address or other identifier. When your app knows which user is trying to authenticate, you can provide this parameter to pre-fill the email box or select the right session for sign-in.

            This currently only affects the classic Lock experience.

            @@ -37,9 +37,11 @@

            This will specify an organization parameter in your user's login request.

            • If you provide an Organization ID (a string with the prefix org_), it will be validated against the org_id claim of your user's ID Token. The validation is case-sensitive.
            • -
            • If you provide an Organization Name (a string without the prefix org_), it will be validated against the org_name claim of your user's ID Token. The validation is case-insensitive.
            • +
            • If you provide an Organization Name (a string without the prefix org_), it will be validated against the org_name claim of your user's ID Token. The validation is case-insensitive. +To use an Organization Name you must have "Allow Organization Names in Authentication API" switched on in your Auth0 settings dashboard. +More information is available on the Auth0 documentation portal
            -
            prompt?: "none" | "login" | "consent" | "select_account"
              +
            prompt?: "none" | "login" | "consent" | "select_account"
            • 'none': do not prompt user for login or consent on reauthentication
            • 'login': prompt user for reauthentication
            • 'consent': prompt user for consent before processing request
            • @@ -50,7 +52,7 @@ the "Allowed Callback URLs" field in your Auth0 Application's settings. If not provided here, it should be provided in the other methods that provide authentication.

              -
            scope?: string

            The default scope to be used on authentication requests.

            +
            scope?: string

            The default scope to be used on authentication requests.

            This defaults to profile email if not set. If you are setting extra scopes and require profile and email to be included then you must include them in the provided scope.

            Note: The openid scope is always applied regardless of this setting.

            diff --git a/docs/interfaces/GetTokenSilentlyOptions.html b/docs/interfaces/GetTokenSilentlyOptions.html index 7679758d..ace8ec54 100644 --- a/docs/interfaces/GetTokenSilentlyOptions.html +++ b/docs/interfaces/GetTokenSilentlyOptions.html @@ -1,4 +1,4 @@ -GetTokenSilentlyOptions | @auth0/auth0-react
            @auth0/auth0-react
              Preparing search index...

              Interface GetTokenSilentlyOptions

              interface GetTokenSilentlyOptions {
                  authorizationParams?: {
                      audience?: string;
                      redirect_uri?: string;
                      scope?: string;
                      [key: string]: any;
                  };
                  cacheMode?: "on"
                  | "off"
                  | "cache-only";
                  detailedResponse?: boolean;
                  timeoutInSeconds?: number;
              }
              Index

              Properties

              authorizationParams? +GetTokenSilentlyOptions | @auth0/auth0-react
              @auth0/auth0-react
                Preparing search index...

                Interface GetTokenSilentlyOptions

                interface GetTokenSilentlyOptions {
                    authorizationParams?: {
                        audience?: string;
                        redirect_uri?: string;
                        scope?: string;
                        [key: string]: any;
                    };
                    cacheMode?: "on"
                    | "off"
                    | "cache-only";
                    detailedResponse?: boolean;
                    timeoutInSeconds?: number;
                }
                Index

                Properties

                authorizationParams? cacheMode? detailedResponse? timeoutInSeconds? @@ -13,13 +13,13 @@ It must be whitelisted in the "Allowed Web Origins" in your Auth0 Application's settings.

              • Optionalscope?: string

                The scope that was used in the authentication request

                -
              • cacheMode?: "on" | "off" | "cache-only"

                When off, ignores the cache and always sends a +

                cacheMode?: "on" | "off" | "cache-only"

                When off, ignores the cache and always sends a request to Auth0. When cache-only, only reads from the cache and never sends a request to Auth0. Defaults to on, where it both reads from the cache and sends a request to Auth0 as needed.

                -
                detailedResponse?: boolean

                If true, the full response from the /oauth/token endpoint (or the cache, if the cache was used) is returned +

                detailedResponse?: boolean

                If true, the full response from the /oauth/token endpoint (or the cache, if the cache was used) is returned (minus refresh_token if one was issued). Otherwise, just the access token is returned.

                The default is false.

                -
                timeoutInSeconds?: number

                A maximum number of seconds to wait before declaring the background /authorize call as failed for timeout +

                timeoutInSeconds?: number

                A maximum number of seconds to wait before declaring the background /authorize call as failed for timeout Defaults to 60s.

                -
                +
                diff --git a/docs/interfaces/GetTokenWithPopupOptions.html b/docs/interfaces/GetTokenWithPopupOptions.html index ee46a68d..5b79dc30 100644 --- a/docs/interfaces/GetTokenWithPopupOptions.html +++ b/docs/interfaces/GetTokenWithPopupOptions.html @@ -1,8 +1,8 @@ -GetTokenWithPopupOptions | @auth0/auth0-react
                @auth0/auth0-react
                  Preparing search index...

                  Interface GetTokenWithPopupOptions

                  interface GetTokenWithPopupOptions {
                      authorizationParams?: AuthorizationParams;
                      cacheMode?: "on" | "off" | "cache-only";
                  }

                  Hierarchy (View Summary)

                  Index

                  Properties

                  authorizationParams? +GetTokenWithPopupOptions | @auth0/auth0-react
                  @auth0/auth0-react
                    Preparing search index...

                    Interface GetTokenWithPopupOptions

                    interface GetTokenWithPopupOptions {
                        authorizationParams?: AuthorizationParams;
                        cacheMode?: "on" | "off" | "cache-only";
                    }

                    Hierarchy (View Summary)

                    Index

                    Properties

                    authorizationParams?: AuthorizationParams

                    URL parameters that will be sent back to the Authorization Server. This can be known parameters defined by Auth0 or custom parameters that you define.

                    -
                    cacheMode?: "on" | "off" | "cache-only"

                    When off, ignores the cache and always sends a request to Auth0. +

                    cacheMode?: "on" | "off" | "cache-only"

                    When off, ignores the cache and always sends a request to Auth0. When cache-only, only reads from the cache and never sends a request to Auth0. Defaults to on, where it both reads from the cache and sends a request to Auth0 as needed.

                    -
                    +
                    diff --git a/docs/interfaces/IdToken.html b/docs/interfaces/IdToken.html index 80d25c4e..13b8f880 100644 --- a/docs/interfaces/IdToken.html +++ b/docs/interfaces/IdToken.html @@ -1,4 +1,4 @@ -IdToken | @auth0/auth0-react
                    @auth0/auth0-react
                      Preparing search index...

                      Interface IdToken

                      interface IdToken {
                          __raw: string;
                          acr?: string;
                          address?: string;
                          amr?: string[];
                          at_hash?: string;
                          aud?: string;
                          auth_time?: string;
                          azp?: string;
                          birthdate?: string;
                          c_hash?: string;
                          cnf?: string;
                          email?: string;
                          email_verified?: boolean;
                          exp?: number;
                          family_name?: string;
                          gender?: string;
                          given_name?: string;
                          iat?: number;
                          iss?: string;
                          jti?: string;
                          locale?: string;
                          middle_name?: string;
                          name?: string;
                          nbf?: number;
                          nickname?: string;
                          nonce?: string;
                          org_id?: string;
                          org_name?: string;
                          phone_number?: string;
                          phone_number_verified?: boolean;
                          picture?: string;
                          preferred_username?: string;
                          profile?: string;
                          sid?: string;
                          sub_jwk?: string;
                          updated_at?: string;
                          website?: string;
                          zoneinfo?: string;
                          [key: string]: any;
                      }

                      Indexable

                      • [key: string]: any
                      Index

                      Properties

                      __raw +IdToken | @auth0/auth0-react
                      @auth0/auth0-react
                        Preparing search index...

                        Interface IdToken

                        interface IdToken {
                            __raw: string;
                            acr?: string;
                            address?: string;
                            amr?: string[];
                            at_hash?: string;
                            aud?: string;
                            auth_time?: string;
                            azp?: string;
                            birthdate?: string;
                            c_hash?: string;
                            cnf?: string;
                            email?: string;
                            email_verified?: boolean;
                            exp?: number;
                            family_name?: string;
                            gender?: string;
                            given_name?: string;
                            iat?: number;
                            iss?: string;
                            jti?: string;
                            locale?: string;
                            middle_name?: string;
                            name?: string;
                            nbf?: number;
                            nickname?: string;
                            nonce?: string;
                            org_id?: string;
                            org_name?: string;
                            phone_number?: string;
                            phone_number_verified?: boolean;
                            picture?: string;
                            preferred_username?: string;
                            profile?: string;
                            sid?: string;
                            sub_jwk?: string;
                            updated_at?: string;
                            website?: string;
                            zoneinfo?: string;
                            [key: string]: any;
                        }

                        Indexable

                        • [key: string]: any
                        Index

                        Properties

                        Properties

                        __raw: string
                        acr?: string
                        address?: string
                        amr?: string[]
                        at_hash?: string
                        aud?: string
                        auth_time?: string
                        azp?: string
                        birthdate?: string
                        c_hash?: string
                        cnf?: string
                        email?: string
                        email_verified?: boolean
                        exp?: number
                        family_name?: string
                        gender?: string
                        given_name?: string
                        iat?: number
                        iss?: string
                        jti?: string
                        locale?: string
                        middle_name?: string
                        name?: string
                        nbf?: number
                        nickname?: string
                        nonce?: string
                        org_id?: string
                        org_name?: string
                        phone_number?: string
                        phone_number_verified?: boolean
                        picture?: string
                        preferred_username?: string
                        profile?: string
                        sid?: string
                        sub_jwk?: string
                        updated_at?: string
                        website?: string
                        zoneinfo?: string
                        +

                        Properties

                        __raw: string
                        acr?: string
                        address?: string
                        amr?: string[]
                        at_hash?: string
                        aud?: string
                        auth_time?: string
                        azp?: string
                        birthdate?: string
                        c_hash?: string
                        cnf?: string
                        email?: string
                        email_verified?: boolean
                        exp?: number
                        family_name?: string
                        gender?: string
                        given_name?: string
                        iat?: number
                        iss?: string
                        jti?: string
                        locale?: string
                        middle_name?: string
                        name?: string
                        nbf?: number
                        nickname?: string
                        nonce?: string
                        org_id?: string
                        org_name?: string
                        phone_number?: string
                        phone_number_verified?: boolean
                        picture?: string
                        preferred_username?: string
                        profile?: string
                        sid?: string
                        sub_jwk?: string
                        updated_at?: string
                        website?: string
                        zoneinfo?: string
                        diff --git a/docs/interfaces/LogoutOptions.html b/docs/interfaces/LogoutOptions.html index 1a6c08e4..a05e1792 100644 --- a/docs/interfaces/LogoutOptions.html +++ b/docs/interfaces/LogoutOptions.html @@ -1,11 +1,11 @@ -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.

                            If this property is not set, then the clientId that was used during initialization of the SDK is sent to the logout endpoint.

                            If this property is set to null, then no client ID value is sent to the logout endpoint.

                            Read more about how redirecting after logout works

                            -
                            logoutParams?: { federated?: boolean; returnTo?: string; [key: string]: any }

                            Parameters to pass to the logout endpoint. This can be known parameters defined by Auth0 or custom parameters +

                            logoutParams?: { federated?: boolean; returnTo?: string; [key: string]: any }

                            Parameters to pass to the logout endpoint. This can be known parameters defined by Auth0 or custom parameters you wish to provide.

                            Type declaration

                            • [key: string]: any

                              If you need to send custom parameters to the logout endpoint, make sure to use the original parameter name.

                            • Optionalfederated?: boolean

                              When supported by the upstream identity provider, @@ -20,7 +20,7 @@ returnTo URL must be listed in the "Allowed Logout URLs" at the account level in the Auth0 dashboard.

                              Read more about how redirecting after logout works

                              -
                            openUrl?: false | ((url: string) => void | Promise<void>)

                            Used to control the redirect and not rely on the SDK to do the actual redirect.

                            +
                            openUrl?: false | ((url: string) => void | Promise<void>)

                            Used to control the redirect and not rely on the SDK to do the actual redirect.

                            Set to false to disable the redirect, or provide a function to handle the actual redirect yourself.

                            await auth0.logout({
                            openUrl(url) {
                            window.location.replace(url);
                            }
                            });
                            @@ -28,4 +28,4 @@
                            import { Browser } from '@capacitor/browser';

                            await auth0.logout({
                            async openUrl(url) {
                            await Browser.open({ url });
                            }
                            });
                            -
                            +
                            diff --git a/docs/interfaces/LogoutUrlOptions.html b/docs/interfaces/LogoutUrlOptions.html index 5aa4a181..8a7ca5cc 100644 --- a/docs/interfaces/LogoutUrlOptions.html +++ b/docs/interfaces/LogoutUrlOptions.html @@ -1,10 +1,10 @@ -LogoutUrlOptions | @auth0/auth0-react
                            @auth0/auth0-react
                              Preparing search index...

                              Interface LogoutUrlOptions

                              interface LogoutUrlOptions {
                                  clientId?: null | string;
                                  logoutParams?: {
                                      federated?: boolean;
                                      returnTo?: string;
                                      [key: string]: any;
                                  };
                              }
                              Index

                              Properties

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

                                Interface LogoutUrlOptions

                                interface LogoutUrlOptions {
                                    clientId?: null | string;
                                    logoutParams?: {
                                        federated?: boolean;
                                        returnTo?: string;
                                        [key: string]: any;
                                    };
                                }
                                Index

                                Properties

                                clientId?: null | string

                                The clientId of your application.

                                If this property is not set, then the clientId that was used during initialization of the SDK is sent to the logout endpoint.

                                If this property is set to null, then no client ID value is sent to the logout endpoint.

                                Read more about how redirecting after logout works

                                -
                                logoutParams?: { federated?: boolean; returnTo?: string; [key: string]: any }

                                Parameters to pass to the logout endpoint. This can be known parameters defined by Auth0 or custom parameters +

                                logoutParams?: { federated?: boolean; returnTo?: string; [key: string]: any }

                                Parameters to pass to the logout endpoint. This can be known parameters defined by Auth0 or custom parameters you wish to provide.

                                Type declaration

                                • [key: string]: any

                                  If you need to send custom parameters to the logout endpoint, make sure to use the original parameter name.

                                • Optionalfederated?: boolean

                                  When supported by the upstream identity provider, @@ -19,4 +19,4 @@ returnTo URL must be listed in the "Allowed Logout URLs" at the account level in the Auth0 dashboard.

                                  Read more about how redirecting after logout works

                                  -
                                +
                                diff --git a/docs/interfaces/PopupConfigOptions.html b/docs/interfaces/PopupConfigOptions.html index 92b6983d..d02c2248 100644 --- a/docs/interfaces/PopupConfigOptions.html +++ b/docs/interfaces/PopupConfigOptions.html @@ -1,8 +1,8 @@ -PopupConfigOptions | @auth0/auth0-react
                                @auth0/auth0-react
                                  Preparing search index...

                                  Interface PopupConfigOptions

                                  interface PopupConfigOptions {
                                      popup?: any;
                                      timeoutInSeconds?: number;
                                  }
                                  Index

                                  Properties

                                  popup? +PopupConfigOptions | @auth0/auth0-react
                                  @auth0/auth0-react
                                    Preparing search index...

                                    Interface PopupConfigOptions

                                    interface PopupConfigOptions {
                                        popup?: any;
                                        timeoutInSeconds?: number;
                                    }
                                    Index

                                    Properties

                                    popup?: any

                                    Accepts an already-created popup window to use. If not specified, the SDK will create its own. This may be useful for platforms like iOS that have security restrictions around when popups can be invoked (e.g. from a user click event)

                                    -
                                    timeoutInSeconds?: number

                                    The number of seconds to wait for a popup response before +

                                    timeoutInSeconds?: number

                                    The number of seconds to wait for a popup response before throwing a timeout error. Defaults to 60s

                                    -
                                    +
                                    diff --git a/docs/interfaces/PopupLoginOptions.html b/docs/interfaces/PopupLoginOptions.html index b28288f5..af2eb17d 100644 --- a/docs/interfaces/PopupLoginOptions.html +++ b/docs/interfaces/PopupLoginOptions.html @@ -1,4 +1,4 @@ -PopupLoginOptions | @auth0/auth0-react
                                    @auth0/auth0-react
                                      Preparing search index...

                                      Interface PopupLoginOptions

                                      interface PopupLoginOptions {
                                          authorizationParams?: AuthorizationParams;
                                      }

                                      Hierarchy (View Summary)

                                      Index

                                      Properties

                                      authorizationParams? +PopupLoginOptions | @auth0/auth0-react
                                      @auth0/auth0-react
                                        Preparing search index...

                                        Interface PopupLoginOptions

                                        interface PopupLoginOptions {
                                            authorizationParams?: AuthorizationParams;
                                        }

                                        Hierarchy (View Summary)

                                        Index

                                        Properties

                                        authorizationParams?: AuthorizationParams

                                        URL parameters that will be sent back to the Authorization Server. This can be known parameters defined by Auth0 or custom parameters that you define.

                                        -
                                        +
                                        diff --git a/docs/interfaces/RedirectLoginOptions.html b/docs/interfaces/RedirectLoginOptions.html index f71396b1..e314e32b 100644 --- a/docs/interfaces/RedirectLoginOptions.html +++ b/docs/interfaces/RedirectLoginOptions.html @@ -1,16 +1,16 @@ -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?: TAppState

                                            Used to store state before doing the redirect

                                            -
                                            authorizationParams?: AuthorizationParams

                                            URL parameters that will be sent back to the Authorization Server. This can be known parameters +

                                            authorizationParams?: AuthorizationParams

                                            URL parameters that will be sent back to the Authorization Server. This can be known parameters defined by Auth0 or custom parameters that you define.

                                            -
                                            fragment?: string

                                            Used to add to the URL fragment before redirecting

                                            -
                                            openUrl?: (url: string) => void | Promise<void>

                                            Used to control the redirect and not rely on the SDK to do the actual redirect.

                                            +
                                            fragment?: string

                                            Used to add to the URL fragment before redirecting

                                            +
                                            openUrl?: (url: string) => void | Promise<void>

                                            Used to control the redirect and not rely on the SDK to do the actual redirect.

                                            const client = new Auth0Client({
                                            openUrl(url) {
                                            window.location.replace(url);
                                            }
                                            });
                                            import { Browser } from '@capacitor/browser';

                                            const client = new Auth0Client({
                                            async openUrl(url) {
                                            await Browser.open({ url });
                                            }
                                            });
                                            -
                                            +
                                            diff --git a/docs/interfaces/WithAuth0Props.html b/docs/interfaces/WithAuth0Props.html index b0d4b8e2..d80f2eb4 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 bb8150d4..be3c8c0d 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 7cb36e8c..9967e928 100644 --- a/docs/types/AppState.html +++ b/docs/types/AppState.html @@ -1,3 +1,3 @@ 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.

                                                  -
                                                  type AppState = {
                                                      returnTo?: string;
                                                      [key: string]: any;
                                                  }

                                                  Indexable

                                                  • [key: string]: any
                                                  Index

                                                  Properties

                                                  Properties

                                                  returnTo?: string
                                                  +
                                                  type AppState = {
                                                      returnTo?: string;
                                                      [key: string]: any;
                                                  }

                                                  Indexable

                                                  • [key: string]: any
                                                  Index

                                                  Properties

                                                  Properties

                                                  returnTo?: string
                                                  diff --git a/docs/types/CacheLocation.html b/docs/types/CacheLocation.html index 4f585572..53cf383d 100644 --- a/docs/types/CacheLocation.html +++ b/docs/types/CacheLocation.html @@ -1,2 +1,2 @@ CacheLocation | @auth0/auth0-react
                                                  @auth0/auth0-react
                                                    Preparing search index...

                                                    Type Alias CacheLocation

                                                    CacheLocation: "memory" | "localstorage"

                                                    The possible locations where tokens can be stored

                                                    -
                                                    +
                                                    diff --git a/docs/variables/Auth0Context.html b/docs/variables/Auth0Context.html index 0224bee1..c07ff85c 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 334e6865..52ad95af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@auth0/auth0-react", - "version": "2.3.0", + "version": "2.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@auth0/auth0-react", - "version": "2.3.0", + "version": "2.4.0", "license": "MIT", "dependencies": { "@auth0/auth0-spa-js": "^2.2.0" diff --git a/package.json b/package.json index fd0521a8..7d055e55 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "author": "Auth0", "name": "@auth0/auth0-react", - "version": "2.3.0", + "version": "2.4.0", "description": "Auth0 SDK for React Single Page Applications (SPA)", "keywords": [ "auth0",