@versini/auth0-react-thin 2.19.0 → 2.21.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/README.md +19 -179
- package/dist/auth0-context.d.ts +18 -1
- package/dist/auth0-context.d.ts.map +1 -1
- package/dist/auth0-provider.d.ts.map +1 -1
- package/dist/auth0-react.cjs.js +7 -3
- package/dist/auth0-react.cjs.js.map +1 -1
- package/dist/auth0-react.esm.js +7 -3
- package/dist/auth0-react.esm.js.map +1 -1
- package/dist/auth0-react.js +30 -26
- 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 +9 -11
- package/src/auth0-context.tsx +19 -0
- package/src/auth0-provider.tsx +9 -0
- package/src/index.tsx +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ 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
6
|
export { AuthorizationParams, PopupLoginOptions, PopupConfigOptions, GetTokenWithPopupOptions, LogoutUrlOptions, CacheLocation, GetTokenSilentlyOptions, IdToken, User, ICache, InMemoryCache, LocalStorageCache, Cacheable, TimeoutError, MfaRequiredError, PopupCancelledError, PopupTimeoutError, PopupOpenError, AuthenticationError, MissingRefreshTokenError, GenericError, UseDpopNonceError, RedirectConnectAccountOptions, ConnectAccountRedirectResult, ResponseType, ConnectError, CustomTokenExchangeOptions, TokenEndpointResponse, ActClaim, ClientConfiguration, MfaError, MfaListAuthenticatorsError, MfaEnrollmentError, MfaChallengeError, MfaVerifyError, MfaEnrollmentFactorsError, PasskeyError, PasskeyRegisterError, PasskeyChallengeError, PasskeyGetTokenError, MyAccountApiError, } from '@auth0/auth0-spa-js';
|
|
7
|
-
export type { FetcherConfig, InteractiveErrorHandler, MfaApiClient, Authenticator, MfaFactorType, EnrollParams, EnrollOtpParams, EnrollSmsParams, EnrollVoiceParams, EnrollEmailParams, EnrollPushParams, EnrollmentResponse, ChallengeAuthenticatorParams, ChallengeResponse, VerifyParams, EnrollmentFactor, PasskeyApiClient, PasskeySignupOptions, PasskeyLoginOptions, MyAccountApiClient, AuthenticationMethod, AuthenticationMethodType, Factor, UpdateAuthenticationMethodRequest, EnrollmentChallengeOptions, EnrollmentChallengeResponse, EnrollmentVerifyOptions, } from '@auth0/auth0-spa-js';
|
|
7
|
+
export type { RevokeRefreshTokenOptions, FetcherConfig, InteractiveErrorHandler, MfaApiClient, Authenticator, MfaFactorType, EnrollParams, EnrollOtpParams, EnrollSmsParams, EnrollVoiceParams, EnrollEmailParams, EnrollPushParams, EnrollmentResponse, ChallengeAuthenticatorParams, ChallengeResponse, VerifyParams, EnrollmentFactor, PasskeyApiClient, PasskeySignupOptions, PasskeyLoginOptions, MyAccountApiClient, AuthenticationMethod, AuthenticationMethodType, Factor, UpdateAuthenticationMethodRequest, EnrollmentChallengeOptions, EnrollmentChallengeResponse, EnrollmentVerifyOptions, } from '@auth0/auth0-spa-js';
|
|
8
8
|
export { OAuthError } from './errors';
|
|
9
9
|
//# 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,8BAA8B,EAC9B,8BAA8B,EAC9B,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,EA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,EACb,aAAa,EACb,YAAY,EACZ,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,4BAA4B,EAC5B,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAEhB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EAEnB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,MAAM,EACN,iCAAiC,EACjC,0BAA0B,EAC1B,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Auth0",
|
|
3
3
|
"name": "@versini/auth0-react-thin",
|
|
4
|
-
"version": "2.
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "2.21.0",
|
|
5
|
+
"description": "Unofficial slim fork of @auth0/auth0-react@2.21.0 — bundle-size build, not affiliated with Auth0/Okta. See @versini/auth0-thin.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"auth0",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"SPA authentication",
|
|
13
|
-
"react"
|
|
8
|
+
"fork",
|
|
9
|
+
"bundle-size",
|
|
10
|
+
"tree-shaking",
|
|
11
|
+
"thin"
|
|
14
12
|
],
|
|
15
13
|
"files": [
|
|
16
14
|
"src",
|
|
@@ -26,7 +24,7 @@
|
|
|
26
24
|
},
|
|
27
25
|
"license": "MIT",
|
|
28
26
|
"bugs": {
|
|
29
|
-
"url": "https://github.com/
|
|
27
|
+
"url": "https://github.com/versini-org/auth0-thin/issues"
|
|
30
28
|
},
|
|
31
29
|
"homepage": "https://github.com/versini-org/auth0-thin#readme",
|
|
32
30
|
"peerDependencies": {
|
|
@@ -34,9 +32,9 @@
|
|
|
34
32
|
"react-dom": "^16.11.0 || ^17 || ^18 || ~19.0.1 || ~19.1.2 || ^19.2.1"
|
|
35
33
|
},
|
|
36
34
|
"dependencies": {
|
|
37
|
-
"@auth0/auth0-spa-js": "^2.
|
|
35
|
+
"@auth0/auth0-spa-js": "^2.22.0"
|
|
38
36
|
},
|
|
39
|
-
"forkedFrom": "@auth0/auth0-react@2.
|
|
37
|
+
"forkedFrom": "@auth0/auth0-react@2.21.0",
|
|
40
38
|
"publishConfig": {
|
|
41
39
|
"access": "public"
|
|
42
40
|
}
|
package/src/auth0-context.tsx
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
ConnectAccountRedirectResult,
|
|
15
15
|
CustomTokenExchangeOptions,
|
|
16
16
|
TokenEndpointResponse,
|
|
17
|
+
type RevokeRefreshTokenOptions,
|
|
17
18
|
type MfaApiClient,
|
|
18
19
|
type PasskeyApiClient,
|
|
19
20
|
type MyAccountApiClient
|
|
@@ -273,6 +274,23 @@ export interface Auth0ContextInterface<TUser extends User = User>
|
|
|
273
274
|
*/
|
|
274
275
|
logout: (options?: LogoutOptions) => Promise<void>;
|
|
275
276
|
|
|
277
|
+
/**
|
|
278
|
+
* ```js
|
|
279
|
+
* await revokeRefreshToken();
|
|
280
|
+
* // or for a specific audience:
|
|
281
|
+
* await revokeRefreshToken({ audience: 'https://api.example.com' });
|
|
282
|
+
* ```
|
|
283
|
+
*
|
|
284
|
+
* Revokes the refresh token for the current session by calling the
|
|
285
|
+
* `/oauth/revoke` endpoint. Once revoked, the token can no longer be
|
|
286
|
+
* used to obtain new access tokens.
|
|
287
|
+
*
|
|
288
|
+
* If `useRefreshTokens` is not enabled this is a no-op.
|
|
289
|
+
* When multiple audiences share the same refresh token, revoking for
|
|
290
|
+
* one audience invalidates it for all of them.
|
|
291
|
+
*/
|
|
292
|
+
revokeRefreshToken: (options?: RevokeRefreshTokenOptions) => Promise<void>;
|
|
293
|
+
|
|
276
294
|
/**
|
|
277
295
|
* After the browser redirects back to the callback page,
|
|
278
296
|
* call `handleRedirectCallback` to handle success and error
|
|
@@ -470,6 +488,7 @@ export const initialContext = {
|
|
|
470
488
|
loginWithPopup: stub,
|
|
471
489
|
connectAccountWithRedirect: stub,
|
|
472
490
|
logout: stub,
|
|
491
|
+
revokeRefreshToken: stub,
|
|
473
492
|
handleRedirectCallback: stub,
|
|
474
493
|
getDpopNonce: stub,
|
|
475
494
|
setDpopNonce: stub,
|
package/src/auth0-provider.tsx
CHANGED
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
ResponseType,
|
|
21
21
|
CustomTokenExchangeOptions,
|
|
22
22
|
TokenEndpointResponse,
|
|
23
|
+
type RevokeRefreshTokenOptions,
|
|
23
24
|
type PasskeyApiClient,
|
|
24
25
|
type PasskeySignupOptions,
|
|
25
26
|
type PasskeyLoginOptions
|
|
@@ -259,6 +260,12 @@ const Auth0Provider = <TUser extends User = User>(opts: Auth0ProviderOptions<TUs
|
|
|
259
260
|
[client]
|
|
260
261
|
);
|
|
261
262
|
|
|
263
|
+
const revokeRefreshToken = useCallback(
|
|
264
|
+
(options?: RevokeRefreshTokenOptions): Promise<void> =>
|
|
265
|
+
client.revokeRefreshToken(options),
|
|
266
|
+
[client]
|
|
267
|
+
);
|
|
268
|
+
|
|
262
269
|
const getAccessTokenSilently = useCallback(
|
|
263
270
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
264
271
|
async (opts?: GetTokenSilentlyOptions): Promise<any> => {
|
|
@@ -449,6 +456,7 @@ const Auth0Provider = <TUser extends User = User>(opts: Auth0ProviderOptions<TUs
|
|
|
449
456
|
loginWithPopup,
|
|
450
457
|
connectAccountWithRedirect,
|
|
451
458
|
logout,
|
|
459
|
+
revokeRefreshToken,
|
|
452
460
|
handleRedirectCallback,
|
|
453
461
|
getDpopNonce,
|
|
454
462
|
setDpopNonce,
|
|
@@ -471,6 +479,7 @@ const Auth0Provider = <TUser extends User = User>(opts: Auth0ProviderOptions<TUs
|
|
|
471
479
|
loginWithPopup,
|
|
472
480
|
connectAccountWithRedirect,
|
|
473
481
|
logout,
|
|
482
|
+
revokeRefreshToken,
|
|
474
483
|
handleRedirectCallback,
|
|
475
484
|
getDpopNonce,
|
|
476
485
|
setDpopNonce,
|