@versini/auth0-react-thin 2.24.0 → 2.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { User } from '@auth0/auth0-spa-js';
3
3
  import { Auth0ContextInterface } from './auth0-context';
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"use-auth0-suspense.d.ts","sourceRoot":"","sources":["../src/use-auth0-suspense.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAqB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,6BAA6B,CAAC,KAAK,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CACzE,qBAAqB,CAAC,KAAK,CAAC,EAC5B,WAAW,GAAG,cAAc,CAC7B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,gBAAgB,GAAI,KAAK,SAAS,IAAI,GAAG,IAAI,EACjD,oDAAsB,KACrB,6BAA6B,CAAC,KAAK,CA0BrC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"use-auth0-suspense.d.ts","sourceRoot":"","sources":["../src/use-auth0-suspense.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAqB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,6BAA6B,CAAC,KAAK,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CACzE,qBAAqB,CAAC,KAAK,CAAC,EAC5B,WAAW,GAAG,cAAc,CAC7B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,gBAAgB,GAAI,KAAK,SAAS,IAAI,GAAG,IAAI,EACjD,oDAAsB,KACrB,6BAA6B,CAAC,KAAK,CA0BrC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "author": "Auth0",
3
3
  "name": "@versini/auth0-react-thin",
4
- "version": "2.24.0",
5
- "description": "Unofficial slim fork of @auth0/auth0-react@2.24.0 — bundle-size build, not affiliated with Auth0/Okta. See @versini/auth0-thin.",
4
+ "version": "2.25.0",
5
+ "description": "Unofficial slim fork of @auth0/auth0-react@2.25.0 — bundle-size build, not affiliated with Auth0/Okta. See @versini/auth0-thin.",
6
6
  "keywords": [
7
7
  "auth0",
8
8
  "fork",
@@ -32,9 +32,9 @@
32
32
  "react-dom": "^16.11.0 || ^17 || ^18 || ~19.0.1 || ~19.1.2 || ^19.2.1"
33
33
  },
34
34
  "dependencies": {
35
- "@auth0/auth0-spa-js": "^2.24.1"
35
+ "@auth0/auth0-spa-js": "^2.25.0"
36
36
  },
37
- "forkedFrom": "@auth0/auth0-react@2.24.0",
37
+ "forkedFrom": "@auth0/auth0-react@2.25.0",
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  }
@@ -1,5 +1,4 @@
1
1
  import {
2
- GetTokenSilentlyOptions,
3
2
  GetTokenWithPopupOptions,
4
3
  IdToken,
5
4
  LogoutOptions as SPALogoutOptions,
@@ -7,7 +6,6 @@ import {
7
6
  PopupConfigOptions,
8
7
  RedirectLoginResult,
9
8
  User,
10
- GetTokenSilentlyVerboseResponse,
11
9
  RedirectLoginOptions as SPARedirectLoginOptions,
12
10
  type Auth0Client,
13
11
  RedirectConnectAccountOptions,
@@ -47,7 +45,7 @@ export interface Auth0ContextInterface<TUser extends User = User>
47
45
  *
48
46
  * If refresh tokens are used, the token endpoint is called directly with the
49
47
  * 'refresh_token' grant. If no refresh token is available to make this call,
50
- * the SDK will only fall back to using an iframe to the '/authorize' URL if
48
+ * the SDK will only fall back to using an iframe to the '/authorize' URL if
51
49
  * the `useRefreshTokensFallback` setting has been set to `true`. By default this
52
50
  * setting is `false`.
53
51
  *
@@ -60,15 +58,7 @@ export interface Auth0ContextInterface<TUser extends User = User>
60
58
  * Note that in all cases, falling back to an iframe requires access to
61
59
  * the `auth0` cookie.
62
60
  */
63
- getAccessTokenSilently: {
64
- (
65
- options: GetTokenSilentlyOptions & { detailedResponse: true }
66
- ): Promise<GetTokenSilentlyVerboseResponse>;
67
- (options?: GetTokenSilentlyOptions): Promise<string>;
68
- (options: GetTokenSilentlyOptions): Promise<
69
- GetTokenSilentlyVerboseResponse | string
70
- >;
71
- };
61
+ getAccessTokenSilently: Auth0Client['getTokenSilently'];
72
62
 
73
63
  /**
74
64
  * ```js
@@ -1,7 +1,9 @@
1
- // Namespace import: `use` only exists as a named export from React 19, so
2
- // `import { use }` fails at link time for React 16-18 consumers even if they
3
- // never call this hook. Property access stays late-bound.
4
- import * as React from 'react';
1
+ // Default import, NOT `import * as React`: webpack checks namespace member names
2
+ // against the module's export list, so `React.use` on a namespace binding warns
3
+ // for React 16-18 consumers even if they never call this hook (#1205). A default
4
+ // import is react's module.exports object, so the read is unchecked. Named
5
+ // (`import { use }`) is worse still: it fails at link time.
6
+ import React, { useContext, useMemo } from 'react';
5
7
  import { User } from '@auth0/auth0-spa-js';
6
8
  import Auth0Context, { Auth0ContextInterface } from './auth0-context';
7
9
 
@@ -47,7 +49,7 @@ const useAuth0Suspense = <TUser extends User = User>(
47
49
  );
48
50
  }
49
51
 
50
- const ctx = React.useContext(context) as Auth0ContextInterface<TUser>;
52
+ const ctx = useContext(context) as Auth0ContextInterface<TUser>;
51
53
 
52
54
  if (!ctx._initPromise) {
53
55
  throw new Error(
@@ -61,7 +63,7 @@ const useAuth0Suspense = <TUser extends User = User>(
61
63
  // Memoized so the returned object is referentially stable across renders,
62
64
  // matching useAuth0, which hands back the provider's memoized context.
63
65
  // Without this, `useEffect(..., [auth])` in a consumer re-runs every render.
64
- return React.useMemo(() => {
66
+ return useMemo(() => {
65
67
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
66
68
  const { isLoading, _initPromise, ...rest } = ctx;
67
69
  return rest;