@versini/auth0-react-thin 2.21.0 → 2.22.1
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 +1 -1
- package/dist/auth0-context.d.ts +16 -4
- package/dist/auth0-context.d.ts.map +1 -1
- package/dist/auth0-provider.d.ts.map +1 -1
- package/dist/auth0-react.cjs.js +51 -4
- package/dist/auth0-react.cjs.js.map +1 -1
- package/dist/auth0-react.esm.js +40 -5
- package/dist/auth0-react.esm.js.map +1 -1
- package/dist/auth0-react.js +58 -20
- 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/dist/reducer.d.ts +1 -1
- package/dist/reducer.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/auth0-context.tsx +16 -4
- package/src/auth0-provider.tsx +16 -2
- package/src/index.tsx +3 -0
- package/src/reducer.tsx +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ 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, 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';
|
|
6
|
+
export { AuthorizationParams, PopupLoginOptions, PopupConfigOptions, GetTokenWithPopupOptions, LogoutUrlOptions, CacheLocation, GetTokenSilentlyOptions, IdToken, User, ICache, InMemoryCache, LocalStorageCache, Cacheable, TimeoutError, MfaRequiredError, PopupCancelledError, PopupTimeoutError, PopupOpenError, AuthenticationError, MissingRefreshTokenError, MissingScopesError, InvalidConfigurationError, GenericError, UseDpopNonceError, RedirectConnectAccountOptions, ConnectAccountRedirectResult, ResponseType, ConnectError, CustomTokenExchangeOptions, TokenEndpointResponse, ActClaim, ClientConfiguration, RefreshTokenMode, MfaError, MfaListAuthenticatorsError, MfaEnrollmentError, MfaChallengeError, MfaVerifyError, MfaEnrollmentFactorsError, PasskeyError, PasskeyRegisterError, PasskeyChallengeError, PasskeyGetTokenError, MyAccountApiError, } from '@auth0/auth0-spa-js';
|
|
7
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,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,cAAc,EACd,mBAAmB,EACnB,wBAAwB,EACxB,YAAY,EACZ,iBAAiB,EACjB,6BAA6B,EAC7B,4BAA4B,EAC5B,YAAY,EACZ,YAAY,EACZ,0BAA0B,EAC1B,qBAAqB,EACrB,QAAQ,EACR,mBAAmB,
|
|
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,EAAE,MAAM,cAAc,CAAC;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,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/reducer.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { AuthState } from './auth-state';
|
|
|
3
3
|
type Action = {
|
|
4
4
|
type: 'LOGIN_POPUP_STARTED';
|
|
5
5
|
} | {
|
|
6
|
-
type: 'INITIALISED' | 'LOGIN_POPUP_COMPLETE' | 'GET_ACCESS_TOKEN_COMPLETE' | 'HANDLE_REDIRECT_COMPLETE';
|
|
6
|
+
type: 'INITIALISED' | 'LOGIN_POPUP_COMPLETE' | 'GET_ACCESS_TOKEN_COMPLETE' | 'HANDLE_REDIRECT_COMPLETE' | 'SYNC_USER';
|
|
7
7
|
user: User | undefined;
|
|
8
8
|
} | {
|
|
9
9
|
type: 'LOGOUT';
|
package/dist/reducer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../src/reducer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,KAAK,MAAM,GACP;IAAE,IAAI,EAAE,qBAAqB,CAAA;CAAE,GAC/B;IACE,IAAI,EACA,aAAa,GACb,sBAAsB,GACtB,2BAA2B,GAC3B,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../src/reducer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,KAAK,MAAM,GACP;IAAE,IAAI,EAAE,qBAAqB,CAAA;CAAE,GAC/B;IACE,IAAI,EACA,aAAa,GACb,sBAAsB,GACtB,2BAA2B,GAC3B,0BAA0B,GAC1B,WAAW,CAAC;IAChB,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC;CACxB,GACD;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,KAAK,SAAS,IAAI,GAAG,IAAI,EAAE,OAAO,SAAS,CAAC,KAAK,CAAC,EAAE,QAAQ,MAAM,KAAG,SAAS,CAAC,KAAK,CAwC3G,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.
|
|
5
|
-
"description": "Unofficial slim fork of @auth0/auth0-react@2.
|
|
4
|
+
"version": "2.22.1",
|
|
5
|
+
"description": "Unofficial slim fork of @auth0/auth0-react@2.22.1 — 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.
|
|
35
|
+
"@auth0/auth0-spa-js": "^2.24.1"
|
|
36
36
|
},
|
|
37
|
-
"forkedFrom": "@auth0/auth0-react@2.
|
|
37
|
+
"forkedFrom": "@auth0/auth0-react@2.22.1",
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
}
|
package/src/auth0-context.tsx
CHANGED
|
@@ -281,13 +281,25 @@ export interface Auth0ContextInterface<TUser extends User = User>
|
|
|
281
281
|
* await revokeRefreshToken({ audience: 'https://api.example.com' });
|
|
282
282
|
* ```
|
|
283
283
|
*
|
|
284
|
-
* Revokes the refresh token
|
|
285
|
-
*
|
|
286
|
-
* used to obtain new access tokens.
|
|
284
|
+
* Revokes the refresh token via the `/oauth/revoke` endpoint. This invalidates the
|
|
285
|
+
* refresh token so it can no longer be used to obtain new access tokens.
|
|
287
286
|
*
|
|
288
|
-
* If `useRefreshTokens` is
|
|
287
|
+
* If `useRefreshTokens` is disabled, this method does nothing.
|
|
289
288
|
* When multiple audiences share the same refresh token, revoking for
|
|
290
289
|
* one audience invalidates it for all of them.
|
|
290
|
+
*
|
|
291
|
+
* **Online mode** (`refreshTokenMode: RefreshTokenMode.Online`): revoking the Online
|
|
292
|
+
* Refresh Token also terminates the Auth0 session server-side and clears the entire
|
|
293
|
+
* local cache. `isAuthenticated` and `user` update immediately to reflect the
|
|
294
|
+
* terminated session — no redirect required. Use `logout()` instead if you want a
|
|
295
|
+
* redirect-based sign-out.
|
|
296
|
+
*
|
|
297
|
+
* **Offline mode**: only the refresh token is invalidated; the cached access token
|
|
298
|
+
* and user profile remain valid until the access token expires. `isAuthenticated`
|
|
299
|
+
* and `user` are unaffected until then.
|
|
300
|
+
*
|
|
301
|
+
* @param options - Optional parameters to identify which refresh token to revoke.
|
|
302
|
+
* Defaults to the audience configured in `authorizationParams`.
|
|
291
303
|
*/
|
|
292
304
|
revokeRefreshToken: (options?: RevokeRefreshTokenOptions) => Promise<void>;
|
|
293
305
|
|
package/src/auth0-provider.tsx
CHANGED
|
@@ -261,8 +261,22 @@ const Auth0Provider = <TUser extends User = User>(opts: Auth0ProviderOptions<TUs
|
|
|
261
261
|
);
|
|
262
262
|
|
|
263
263
|
const revokeRefreshToken = useCallback(
|
|
264
|
-
(
|
|
265
|
-
|
|
264
|
+
async (opts?: RevokeRefreshTokenOptions): Promise<void> => {
|
|
265
|
+
try {
|
|
266
|
+
await client.revokeRefreshToken(opts);
|
|
267
|
+
} finally {
|
|
268
|
+
// Online mode clears the entire local session as part of revocation; offline
|
|
269
|
+
// mode leaves the cached access token/user untouched. Re-reading the user from
|
|
270
|
+
// the client after either case keeps isAuthenticated/user consistent with
|
|
271
|
+
// whatever the SDK actually did, without assuming which mode is active. If
|
|
272
|
+
// revocation fails, nothing was actually revoked, so this re-read simply
|
|
273
|
+
// reflects the unchanged cached user/session.
|
|
274
|
+
dispatch({
|
|
275
|
+
type: 'SYNC_USER',
|
|
276
|
+
user: await client.getUser(),
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
},
|
|
266
280
|
[client]
|
|
267
281
|
);
|
|
268
282
|
|
package/src/index.tsx
CHANGED
|
@@ -40,6 +40,8 @@ export {
|
|
|
40
40
|
PopupOpenError,
|
|
41
41
|
AuthenticationError,
|
|
42
42
|
MissingRefreshTokenError,
|
|
43
|
+
MissingScopesError,
|
|
44
|
+
InvalidConfigurationError,
|
|
43
45
|
GenericError,
|
|
44
46
|
UseDpopNonceError,
|
|
45
47
|
RedirectConnectAccountOptions,
|
|
@@ -50,6 +52,7 @@ export {
|
|
|
50
52
|
TokenEndpointResponse,
|
|
51
53
|
ActClaim,
|
|
52
54
|
ClientConfiguration,
|
|
55
|
+
RefreshTokenMode,
|
|
53
56
|
// MFA Errors
|
|
54
57
|
MfaError,
|
|
55
58
|
MfaListAuthenticatorsError,
|
package/src/reducer.tsx
CHANGED
|
@@ -8,7 +8,8 @@ type Action =
|
|
|
8
8
|
| 'INITIALISED'
|
|
9
9
|
| 'LOGIN_POPUP_COMPLETE'
|
|
10
10
|
| 'GET_ACCESS_TOKEN_COMPLETE'
|
|
11
|
-
| 'HANDLE_REDIRECT_COMPLETE'
|
|
11
|
+
| 'HANDLE_REDIRECT_COMPLETE'
|
|
12
|
+
| 'SYNC_USER';
|
|
12
13
|
user: User | undefined;
|
|
13
14
|
}
|
|
14
15
|
| { type: 'LOGOUT' }
|
|
@@ -35,6 +36,7 @@ export const reducer = <TUser extends User = User>(state: AuthState<TUser>, acti
|
|
|
35
36
|
};
|
|
36
37
|
case 'HANDLE_REDIRECT_COMPLETE':
|
|
37
38
|
case 'GET_ACCESS_TOKEN_COMPLETE':
|
|
39
|
+
case 'SYNC_USER':
|
|
38
40
|
if (state.user === action.user) {
|
|
39
41
|
return state;
|
|
40
42
|
}
|