@auth0/auth0-react 2.11.0 → 2.12.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.
- package/dist/auth0-context.d.ts +11 -0
- package/dist/auth0-context.d.ts.map +1 -1
- package/dist/auth0-provider.d.ts.map +1 -1
- package/dist/auth0-react.cjs.js +19 -17
- package/dist/auth0-react.cjs.js.map +1 -1
- package/dist/auth0-react.esm.js +9 -7
- package/dist/auth0-react.esm.js.map +1 -1
- package/dist/auth0-react.js +19 -17
- package/dist/auth0-react.js.map +1 -1
- package/dist/auth0-react.min.js +1 -1
- package/dist/auth0-react.min.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/auth0-context.tsx +13 -1
- package/src/auth0-provider.tsx +7 -0
- package/src/index.tsx +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ export { default as useAuth0 } from './use-auth0';
|
|
|
3
3
|
export { default as withAuth0, WithAuth0Props } from './with-auth0';
|
|
4
4
|
export { default as withAuthenticationRequired, WithAuthenticationRequiredOptions, } from './with-authentication-required';
|
|
5
5
|
export { default as Auth0Context, Auth0ContextInterface, initialContext, LogoutOptions, RedirectLoginOptions, } from './auth0-context';
|
|
6
|
-
export { AuthorizationParams, PopupLoginOptions, PopupConfigOptions, GetTokenWithPopupOptions, LogoutUrlOptions, CacheLocation, GetTokenSilentlyOptions, IdToken, User, ICache, InMemoryCache, LocalStorageCache, Cacheable, TimeoutError, MfaRequiredError, PopupCancelledError, PopupTimeoutError, AuthenticationError, MissingRefreshTokenError, GenericError, UseDpopNonceError, type FetcherConfig, RedirectConnectAccountOptions, ConnectAccountRedirectResult, ResponseType, ConnectError, CustomTokenExchangeOptions, TokenEndpointResponse } from '@auth0/auth0-spa-js';
|
|
6
|
+
export { AuthorizationParams, PopupLoginOptions, PopupConfigOptions, GetTokenWithPopupOptions, LogoutUrlOptions, CacheLocation, GetTokenSilentlyOptions, IdToken, User, ICache, InMemoryCache, LocalStorageCache, Cacheable, TimeoutError, MfaRequiredError, PopupCancelledError, PopupTimeoutError, AuthenticationError, MissingRefreshTokenError, GenericError, UseDpopNonceError, type FetcherConfig, RedirectConnectAccountOptions, ConnectAccountRedirectResult, ResponseType, ConnectError, CustomTokenExchangeOptions, TokenEndpointResponse, ClientConfiguration, } from '@auth0/auth0-spa-js';
|
|
7
7
|
export { OAuthError } from './errors';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,aAAa,EACxB,oBAAoB,EACpB,QAAQ,EACR,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EACL,OAAO,IAAI,0BAA0B,EACrC,iCAAiC,GAClC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,OAAO,IAAI,YAAY,EACvB,qBAAqB,EACrB,cAAc,EACd,aAAa,EACb,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,aAAa,EACb,uBAAuB,EACvB,OAAO,EACP,IAAI,EACJ,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,YAAY,EACZ,iBAAiB,EACjB,KAAK,aAAa,EAClB,6BAA6B,EAC7B,4BAA4B,EAC5B,YAAY,EACZ,YAAY,EACZ,0BAA0B,EAC1B,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,aAAa,EACxB,oBAAoB,EACpB,QAAQ,EACR,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EACL,OAAO,IAAI,0BAA0B,EACrC,iCAAiC,GAClC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,OAAO,IAAI,YAAY,EACvB,qBAAqB,EACrB,cAAc,EACd,aAAa,EACb,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,aAAa,EACb,uBAAuB,EACvB,OAAO,EACP,IAAI,EACJ,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,YAAY,EACZ,iBAAiB,EACjB,KAAK,aAAa,EAClB,6BAA6B,EAC7B,4BAA4B,EAC5B,YAAY,EACZ,YAAY,EACZ,0BAA0B,EAC1B,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Auth0",
|
|
3
3
|
"name": "@auth0/auth0-react",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.12.0",
|
|
5
5
|
"description": "Auth0 SDK for React Single Page Applications (SPA)",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"auth0",
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
"@rollup/plugin-replace": "^5.0.1",
|
|
56
56
|
"@rollup/plugin-terser": "^0.4.3",
|
|
57
57
|
"@testing-library/dom": "^10.4.0",
|
|
58
|
-
"@testing-library/jest-dom": "6.
|
|
59
|
-
"@testing-library/react": "16.3.
|
|
58
|
+
"@testing-library/jest-dom": "6.9.1",
|
|
59
|
+
"@testing-library/react": "16.3.2",
|
|
60
60
|
"@types/jest": "^29.5.14",
|
|
61
|
-
"@types/react": "19.
|
|
62
|
-
"@types/react-dom": "19.
|
|
61
|
+
"@types/react": "19.2.10",
|
|
62
|
+
"@types/react-dom": "19.2.3",
|
|
63
63
|
"@typescript-eslint/eslint-plugin": "^8.36.0",
|
|
64
64
|
"@typescript-eslint/parser": "^8.36.0",
|
|
65
65
|
"browserstack-cypress-cli": "^1.19.1",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"oidc-provider": "^8.8.1",
|
|
75
75
|
"prettier": "^2.8.1",
|
|
76
76
|
"pretty-quick": "^3.1.3",
|
|
77
|
-
"react": "19.
|
|
78
|
-
"react-dom": "19.
|
|
77
|
+
"react": "19.2.4",
|
|
78
|
+
"react-dom": "19.2.4",
|
|
79
79
|
"rollup": "^3.7.0",
|
|
80
80
|
"rollup-plugin-analyzer": "^4.0.0",
|
|
81
81
|
"rollup-plugin-delete": "^2.0.0",
|
|
@@ -95,6 +95,6 @@
|
|
|
95
95
|
"react-dom": "^16.11.0 || ^17 || ^18 || ~19.0.1 || ~19.1.2 || ^19.2.1"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@auth0/auth0-spa-js": "^2.
|
|
98
|
+
"@auth0/auth0-spa-js": "^2.12.0"
|
|
99
99
|
}
|
|
100
100
|
}
|
package/src/auth0-context.tsx
CHANGED
|
@@ -237,10 +237,21 @@ export interface Auth0ContextInterface<TUser extends User = User>
|
|
|
237
237
|
* This is a drop-in replacement for the Fetch API's `fetch()` method, but will
|
|
238
238
|
* handle certain authentication logic for you, like building the proper auth
|
|
239
239
|
* headers or managing DPoP nonces and retries automatically.
|
|
240
|
-
*
|
|
240
|
+
*
|
|
241
241
|
* Check the `EXAMPLES.md` file for a deeper look into this method.
|
|
242
242
|
*/
|
|
243
243
|
createFetcher: Auth0Client['createFetcher'];
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* ```js
|
|
247
|
+
* const config = getConfiguration();
|
|
248
|
+
* // { domain: 'tenant.auth0.com', clientId: 'abc123' }
|
|
249
|
+
* ```
|
|
250
|
+
*
|
|
251
|
+
* Returns a readonly copy of the initialization configuration
|
|
252
|
+
* containing the domain and clientId.
|
|
253
|
+
*/
|
|
254
|
+
getConfiguration: Auth0Client['getConfiguration'];
|
|
244
255
|
}
|
|
245
256
|
|
|
246
257
|
/**
|
|
@@ -270,6 +281,7 @@ export const initialContext = {
|
|
|
270
281
|
setDpopNonce: stub,
|
|
271
282
|
generateDpopProof: stub,
|
|
272
283
|
createFetcher: stub,
|
|
284
|
+
getConfiguration: stub,
|
|
273
285
|
};
|
|
274
286
|
|
|
275
287
|
/**
|
package/src/auth0-provider.tsx
CHANGED
|
@@ -341,6 +341,11 @@ const Auth0Provider = <TUser extends User = User>(opts: Auth0ProviderOptions<TUs
|
|
|
341
341
|
[client]
|
|
342
342
|
);
|
|
343
343
|
|
|
344
|
+
const getConfiguration = useCallback<Auth0Client['getConfiguration']>(
|
|
345
|
+
() => client.getConfiguration(),
|
|
346
|
+
[client]
|
|
347
|
+
);
|
|
348
|
+
|
|
344
349
|
const contextValue = useMemo<Auth0ContextInterface<TUser>>(() => {
|
|
345
350
|
return {
|
|
346
351
|
...state,
|
|
@@ -357,6 +362,7 @@ const Auth0Provider = <TUser extends User = User>(opts: Auth0ProviderOptions<TUs
|
|
|
357
362
|
setDpopNonce,
|
|
358
363
|
generateDpopProof,
|
|
359
364
|
createFetcher,
|
|
365
|
+
getConfiguration,
|
|
360
366
|
};
|
|
361
367
|
}, [
|
|
362
368
|
state,
|
|
@@ -373,6 +379,7 @@ const Auth0Provider = <TUser extends User = User>(opts: Auth0ProviderOptions<TUs
|
|
|
373
379
|
setDpopNonce,
|
|
374
380
|
generateDpopProof,
|
|
375
381
|
createFetcher,
|
|
382
|
+
getConfiguration,
|
|
376
383
|
]);
|
|
377
384
|
|
|
378
385
|
return <context.Provider value={contextValue}>{children}</context.Provider>;
|