@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/README.md
CHANGED
|
@@ -1,185 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
# @versini/auth0-react-thin
|
|
2
2
|
|
|
3
|
-
[
|
|
4
|
-
[](https://codecov.io/gh/auth0/auth0-react)
|
|
5
|
-
[](https://deepwiki.com/auth0/auth0-react)
|
|
6
|
-

|
|
7
|
-
[](https://opensource.org/licenses/MIT)
|
|
8
|
-
[](https://circleci.com/gh/auth0/auth0-react)
|
|
3
|
+
> **Unofficial, community-maintained fork of [`@auth0/auth0-react`](https://www.npmjs.com/package/@auth0/auth0-react) — NOT affiliated with, endorsed by, sponsored by, or supported by Auth0 or Okta.**
|
|
9
4
|
|
|
10
|
-
|
|
5
|
+
This is [`@auth0/auth0-react@2.21.0`](https://www.npmjs.com/package/@auth0/auth0-react/v/2.21.0)
|
|
6
|
+
rebuilt with a single one-line Rollup change (`external: ['@auth0/auth0-spa-js']`) so it no
|
|
7
|
+
longer inlines that dependency. That drops ~26 KB gzip of first-paint weight for apps that use
|
|
8
|
+
only basic Auth0 login (no MFA/Passkey/MyAccount/DPoP). The public runtime API is otherwise
|
|
9
|
+
unchanged from upstream.
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
**You almost certainly want the official package instead:
|
|
12
|
+
[`@auth0/auth0-react`](https://www.npmjs.com/package/@auth0/auth0-react).** Use this fork only if you
|
|
13
|
+
have deliberately opted into the slim build via
|
|
14
|
+
[`@versini/auth0-thin`](https://github.com/versini-org/auth0-thin).
|
|
13
15
|
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
- [Examples](https://github.com/auth0/auth0-react/blob/main/EXAMPLES.md) - code samples for common React authentication scenario's.
|
|
18
|
-
- [Docs site](https://www.auth0.com/docs) - explore our docs site and learn more about Auth0.
|
|
16
|
+
- What changed, why, and how it's built: https://github.com/versini-org/auth0-thin
|
|
17
|
+
- Issues with the slim build go to the `auth0-thin` repo, **not** to Auth0.
|
|
18
|
+
- For official docs and support, go to Auth0.
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## License & trademarks
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
npm install @auth0/auth0-react
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Using [yarn](https://yarnpkg.com/)
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
yarn add @auth0/auth0-react
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### Configure Auth0
|
|
37
|
-
|
|
38
|
-
Create a **Single Page Application** in the [Auth0 Dashboard](https://manage.auth0.com/#/applications).
|
|
39
|
-
|
|
40
|
-
> **If you're using an existing application**, verify that you have configured the following settings in your Single Page Application:
|
|
41
|
-
>
|
|
42
|
-
> - Click on the "Settings" tab of your application's page.
|
|
43
|
-
> - Scroll down and click on the "Show Advanced Settings" link.
|
|
44
|
-
> - Under "Advanced Settings", click on the "OAuth" tab.
|
|
45
|
-
> - Ensure that "JsonWebToken Signature Algorithm" is set to `RS256` and that "OIDC Conformant" is enabled.
|
|
46
|
-
|
|
47
|
-
Next, configure the following URLs for your application under the "Application URIs" section of the "Settings" page:
|
|
48
|
-
|
|
49
|
-
- **Allowed Callback URLs**: `http://localhost:3000`
|
|
50
|
-
- **Allowed Logout URLs**: `http://localhost:3000`
|
|
51
|
-
- **Allowed Web Origins**: `http://localhost:3000`
|
|
52
|
-
|
|
53
|
-
> These URLs should reflect the origins that your application is running on. **Allowed Callback URLs** may also include a path, depending on where you're handling the callback.
|
|
54
|
-
|
|
55
|
-
Take note of the **Client ID** and **Domain** values under the "Basic Information" section. You'll need these values in the next step.
|
|
56
|
-
|
|
57
|
-
### Configure the SDK
|
|
58
|
-
|
|
59
|
-
Configure the SDK by wrapping your application in `Auth0Provider`:
|
|
60
|
-
|
|
61
|
-
```jsx
|
|
62
|
-
// src/index.js
|
|
63
|
-
import React from 'react';
|
|
64
|
-
import { createRoot } from 'react-dom/client';
|
|
65
|
-
import { Auth0Provider } from '@auth0/auth0-react';
|
|
66
|
-
import App from './App';
|
|
67
|
-
|
|
68
|
-
const root = createRoot(document.getElementById('app'));
|
|
69
|
-
|
|
70
|
-
root.render(
|
|
71
|
-
<Auth0Provider
|
|
72
|
-
domain="YOUR_AUTH0_DOMAIN"
|
|
73
|
-
clientId="YOUR_AUTH0_CLIENT_ID"
|
|
74
|
-
authorizationParams={{
|
|
75
|
-
redirect_uri: window.location.origin,
|
|
76
|
-
}}
|
|
77
|
-
>
|
|
78
|
-
<App />
|
|
79
|
-
</Auth0Provider>
|
|
80
|
-
);
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
<details>
|
|
84
|
-
<summary>Instructions for React <18</summary>
|
|
85
|
-
<br>
|
|
86
|
-
|
|
87
|
-
```jsx
|
|
88
|
-
// src/index.js
|
|
89
|
-
import React from 'react';
|
|
90
|
-
import ReactDOM from 'react-dom';
|
|
91
|
-
import { Auth0Provider } from '@auth0/auth0-react';
|
|
92
|
-
import App from './App';
|
|
93
|
-
|
|
94
|
-
ReactDOM.render(
|
|
95
|
-
<Auth0Provider
|
|
96
|
-
domain="YOUR_AUTH0_DOMAIN"
|
|
97
|
-
clientId="YOUR_AUTH0_CLIENT_ID"
|
|
98
|
-
authorizationParams={{
|
|
99
|
-
redirect_uri: window.location.origin,
|
|
100
|
-
}}
|
|
101
|
-
>
|
|
102
|
-
<App />
|
|
103
|
-
</Auth0Provider>,
|
|
104
|
-
document.getElementById('app')
|
|
105
|
-
);
|
|
106
|
-
```
|
|
107
|
-
</details>
|
|
108
|
-
|
|
109
|
-
Use the `useAuth0` hook in your components to access authentication state (`isLoading`, `isAuthenticated` and `user`) and authentication methods (`loginWithRedirect` and `logout`):
|
|
110
|
-
|
|
111
|
-
```jsx
|
|
112
|
-
// src/App.js
|
|
113
|
-
import React from 'react';
|
|
114
|
-
import { useAuth0 } from '@auth0/auth0-react';
|
|
115
|
-
|
|
116
|
-
function App() {
|
|
117
|
-
const { isLoading, isAuthenticated, error, user, loginWithRedirect, logout } =
|
|
118
|
-
useAuth0();
|
|
119
|
-
|
|
120
|
-
if (isLoading) {
|
|
121
|
-
return <div>Loading...</div>;
|
|
122
|
-
}
|
|
123
|
-
if (error) {
|
|
124
|
-
return <div>Oops... {error.message}</div>;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
if (isAuthenticated) {
|
|
128
|
-
return (
|
|
129
|
-
<div>
|
|
130
|
-
Hello {user.name}{' '}
|
|
131
|
-
<button onClick={() => logout({ logoutParams: { returnTo: window.location.origin } })}>
|
|
132
|
-
Log out
|
|
133
|
-
</button>
|
|
134
|
-
</div>
|
|
135
|
-
);
|
|
136
|
-
} else {
|
|
137
|
-
return <button onClick={() => loginWithRedirect()}>Log in</button>;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export default App;
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
For more code samples on how to integrate **auth0-react** SDK in your **React** application, have a look at our [examples](https://github.com/auth0/auth0-react/blob/main/EXAMPLES.md).
|
|
145
|
-
|
|
146
|
-
## API reference
|
|
147
|
-
|
|
148
|
-
Explore public API's available in auth0-react.
|
|
149
|
-
|
|
150
|
-
- [Auth0Provider](https://auth0.github.io/auth0-react/functions/Auth0Provider.html)
|
|
151
|
-
- [Auth0ProviderOptions](https://auth0.github.io/auth0-react/interfaces/Auth0ProviderOptions.html)
|
|
152
|
-
- [useAuth0](https://auth0.github.io/auth0-react/functions/useAuth0.html)
|
|
153
|
-
- [withAuth0](https://auth0.github.io/auth0-react/functions/withAuth0.html)
|
|
154
|
-
- [withAuthenticationRequired](https://auth0.github.io/auth0-react/functions/withAuthenticationRequired.html)
|
|
155
|
-
|
|
156
|
-
## Feedback
|
|
157
|
-
|
|
158
|
-
### Contributing
|
|
159
|
-
|
|
160
|
-
We appreciate feedback and contribution to this repo! Before you get started, please see the following:
|
|
161
|
-
|
|
162
|
-
- [Auth0's general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
|
|
163
|
-
- [Auth0's code of conduct guidelines](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)
|
|
164
|
-
- [This repo's contribution guide](https://github.com/auth0/auth0-react/blob/main/CONTRIBUTING.md)
|
|
165
|
-
|
|
166
|
-
### Raise an issue
|
|
167
|
-
|
|
168
|
-
To provide feedback or report a bug, please [raise an issue on our issue tracker](https://github.com/auth0/auth0-react/issues).
|
|
169
|
-
|
|
170
|
-
### Vulnerability Reporting
|
|
171
|
-
|
|
172
|
-
Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/responsible-disclosure-policy) details the procedure for disclosing security issues.
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
<p align="center">
|
|
177
|
-
<picture>
|
|
178
|
-
<source media="(prefers-color-scheme: light)" srcset="https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png" width="150">
|
|
179
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://cdn.auth0.com/website/sdks/logos/auth0_dark_mode.png" width="150">
|
|
180
|
-
<img alt="Auth0 Logo" src="https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png" width="150">
|
|
181
|
-
</picture>
|
|
182
|
-
</p>
|
|
183
|
-
<p align="center">Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout <a href="https://auth0.com/why-auth0">Why Auth0?</a></p>
|
|
184
|
-
<p align="center">
|
|
185
|
-
This project is licensed under the MIT license. See the <a href="https://github.com/auth0/auth0-react/blob/main/LICENSE"> LICENSE</a> file for more info.</p>
|
|
22
|
+
The source is Auth0's, redistributed under Auth0's original MIT license, preserved verbatim in
|
|
23
|
+
[`LICENSE`](./LICENSE). MIT covers copyright only and grants no trademark rights. "Auth0" and
|
|
24
|
+
"Okta" are trademarks of Okta, Inc., used here solely nominatively to identify the upstream
|
|
25
|
+
package this build is derived from. This is an independent project, not produced by Okta, Inc.
|
package/dist/auth0-context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GetTokenSilentlyOptions, GetTokenWithPopupOptions, IdToken, LogoutOptions as SPALogoutOptions, PopupLoginOptions, PopupConfigOptions, RedirectLoginResult, User, GetTokenSilentlyVerboseResponse, RedirectLoginOptions as SPARedirectLoginOptions, type Auth0Client, RedirectConnectAccountOptions, ConnectAccountRedirectResult, CustomTokenExchangeOptions, TokenEndpointResponse, type MfaApiClient, type PasskeyApiClient, type MyAccountApiClient } from '@auth0/auth0-spa-js';
|
|
1
|
+
import { GetTokenSilentlyOptions, GetTokenWithPopupOptions, IdToken, LogoutOptions as SPALogoutOptions, PopupLoginOptions, PopupConfigOptions, RedirectLoginResult, User, GetTokenSilentlyVerboseResponse, RedirectLoginOptions as SPARedirectLoginOptions, type Auth0Client, RedirectConnectAccountOptions, ConnectAccountRedirectResult, CustomTokenExchangeOptions, TokenEndpointResponse, type RevokeRefreshTokenOptions, type MfaApiClient, type PasskeyApiClient, type MyAccountApiClient } from '@auth0/auth0-spa-js';
|
|
2
2
|
import { AuthState } from './auth-state';
|
|
3
3
|
import { AppState } from './auth0-provider';
|
|
4
4
|
export interface LogoutOptions extends Omit<SPALogoutOptions, 'onRedirect'> {
|
|
@@ -221,6 +221,22 @@ export interface Auth0ContextInterface<TUser extends User = User> extends AuthSt
|
|
|
221
221
|
* [Read more about how Logout works at Auth0](https://auth0.com/docs/logout).
|
|
222
222
|
*/
|
|
223
223
|
logout: (options?: LogoutOptions) => Promise<void>;
|
|
224
|
+
/**
|
|
225
|
+
* ```js
|
|
226
|
+
* await revokeRefreshToken();
|
|
227
|
+
* // or for a specific audience:
|
|
228
|
+
* await revokeRefreshToken({ audience: 'https://api.example.com' });
|
|
229
|
+
* ```
|
|
230
|
+
*
|
|
231
|
+
* Revokes the refresh token for the current session by calling the
|
|
232
|
+
* `/oauth/revoke` endpoint. Once revoked, the token can no longer be
|
|
233
|
+
* used to obtain new access tokens.
|
|
234
|
+
*
|
|
235
|
+
* If `useRefreshTokens` is not enabled this is a no-op.
|
|
236
|
+
* When multiple audiences share the same refresh token, revoking for
|
|
237
|
+
* one audience invalidates it for all of them.
|
|
238
|
+
*/
|
|
239
|
+
revokeRefreshToken: (options?: RevokeRefreshTokenOptions) => Promise<void>;
|
|
224
240
|
/**
|
|
225
241
|
* After the browser redirects back to the callback page,
|
|
226
242
|
* call `handleRedirectCallback` to handle success and error
|
|
@@ -401,6 +417,7 @@ export declare const initialContext: {
|
|
|
401
417
|
loginWithPopup: () => never;
|
|
402
418
|
connectAccountWithRedirect: () => never;
|
|
403
419
|
logout: () => never;
|
|
420
|
+
revokeRefreshToken: () => never;
|
|
404
421
|
handleRedirectCallback: () => never;
|
|
405
422
|
getDpopNonce: () => never;
|
|
406
423
|
setDpopNonce: () => never;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth0-context.d.ts","sourceRoot":"","sources":["../src/auth0-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,OAAO,EACP,aAAa,IA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmDG;IACH,GAAG,EAAE,YAAY,CAAC;IAElB;;;;;;;;;;;;;OAaG;IACH,OAAO,EAAE,gBAAgB,CAAC;IAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,SAAS,EAAE,kBAAkB,CAAC;CAC/B;AASD;;GAEG;AACH,eAAO,MAAM,cAAc;6BAPV,KAAK;0BAAL,KAAK;kCAAL,KAAK;mCAAL,KAAK;4BAAL,KAAK;wCAAL,KAAK;+BAAL,KAAK;yBAAL,KAAK;6BAAL,KAAK;0BAAL,KAAK;sCAAL,KAAK;kBAAL,KAAK;8BAAL,KAAK;kCAAL,KAAK;wBAAL,KAAK;wBAAL,KAAK;6BAAL,KAAK;yBAAL,KAAK;4BAAL,KAAK;SAkCJ,YAAY;aAIZ,gBAAgB;eAShB,kBAAkB;;;;;CACnC,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,YAAY,sDAAuD,CAAC;AAE1E,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth0-provider.d.ts","sourceRoot":"","sources":["../src/auth0-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AACf,OAAO,EACL,WAAW,EACX,kBAAkB,EAMlB,IAAI,EAEJ,4BAA4B,EAC5B,YAAY,
|
|
1
|
+
{"version":3,"file":"auth0-provider.d.ts","sourceRoot":"","sources":["../src/auth0-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AACf,OAAO,EACL,WAAW,EACX,kBAAkB,EAMlB,IAAI,EAEJ,4BAA4B,EAC5B,YAAY,EAOb,MAAM,qBAAqB,CAAC;AAC7B,OAAqB,EACnB,qBAAqB,EAGtB,MAAM,iBAAiB,CAAC;AAUzB;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,4BAA4B,E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I,KAAK,SAAS,IAAI,GAAG,IAAI,EAAE,MAAM,oBAAoB,CAAC,KAAK,CAAC,sBAmUlF,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/dist/auth0-react.cjs.js
CHANGED
|
@@ -129,7 +129,7 @@ var stub = function () {
|
|
|
129
129
|
/**
|
|
130
130
|
* @ignore
|
|
131
131
|
*/
|
|
132
|
-
var initialContext = __assign(__assign({}, initialAuthState), { buildAuthorizeUrl: stub, buildLogoutUrl: stub, getAccessTokenSilently: stub, getAccessTokenWithPopup: stub, getIdTokenClaims: stub, loginWithCustomTokenExchange: stub, customTokenExchange: stub, exchangeToken: stub, loginWithRedirect: stub, loginWithPopup: stub, connectAccountWithRedirect: stub, logout: stub, handleRedirectCallback: stub, getDpopNonce: stub, setDpopNonce: stub, generateDpopProof: stub, createFetcher: stub, getConfiguration: stub, mfa: {
|
|
132
|
+
var initialContext = __assign(__assign({}, initialAuthState), { buildAuthorizeUrl: stub, buildLogoutUrl: stub, getAccessTokenSilently: stub, getAccessTokenWithPopup: stub, getIdTokenClaims: stub, loginWithCustomTokenExchange: stub, customTokenExchange: stub, exchangeToken: stub, loginWithRedirect: stub, loginWithPopup: stub, connectAccountWithRedirect: stub, logout: stub, revokeRefreshToken: stub, handleRedirectCallback: stub, getDpopNonce: stub, setDpopNonce: stub, generateDpopProof: stub, createFetcher: stub, getConfiguration: stub, mfa: {
|
|
133
133
|
getAuthenticators: stub,
|
|
134
134
|
enroll: stub,
|
|
135
135
|
challenge: stub,
|
|
@@ -254,7 +254,7 @@ var toAuth0ClientOptions = function (opts) {
|
|
|
254
254
|
deprecateRedirectUri(opts);
|
|
255
255
|
return __assign(__assign({}, opts), { auth0Client: {
|
|
256
256
|
name: 'auth0-react',
|
|
257
|
-
version: '2.
|
|
257
|
+
version: '2.21.0',
|
|
258
258
|
} });
|
|
259
259
|
};
|
|
260
260
|
/**
|
|
@@ -383,6 +383,9 @@ var Auth0Provider = function (opts) {
|
|
|
383
383
|
});
|
|
384
384
|
});
|
|
385
385
|
}, [client]);
|
|
386
|
+
var revokeRefreshToken = React.useCallback(function (options) {
|
|
387
|
+
return client.revokeRefreshToken(options);
|
|
388
|
+
}, [client]);
|
|
386
389
|
var getAccessTokenSilently = React.useCallback(
|
|
387
390
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
388
391
|
function (opts) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -580,7 +583,7 @@ var Auth0Provider = function (opts) {
|
|
|
580
583
|
}); }, [client]);
|
|
581
584
|
var passkey = React.useMemo(function () { return ({ signup: passkeySignup, login: passkeyLogin }); }, [passkeySignup, passkeyLogin]);
|
|
582
585
|
var contextValue = React.useMemo(function () {
|
|
583
|
-
return __assign(__assign({}, state), { getAccessTokenSilently: getAccessTokenSilently, getAccessTokenWithPopup: getAccessTokenWithPopup, getIdTokenClaims: getIdTokenClaims, loginWithCustomTokenExchange: loginWithCustomTokenExchange, customTokenExchange: customTokenExchange, exchangeToken: exchangeToken, loginWithRedirect: loginWithRedirect, loginWithPopup: loginWithPopup, connectAccountWithRedirect: connectAccountWithRedirect, logout: logout, handleRedirectCallback: handleRedirectCallback, getDpopNonce: getDpopNonce, setDpopNonce: setDpopNonce, generateDpopProof: generateDpopProof, createFetcher: createFetcher, getConfiguration: getConfiguration, mfa: mfa, passkey: passkey, myAccount: myAccount });
|
|
586
|
+
return __assign(__assign({}, state), { getAccessTokenSilently: getAccessTokenSilently, getAccessTokenWithPopup: getAccessTokenWithPopup, getIdTokenClaims: getIdTokenClaims, loginWithCustomTokenExchange: loginWithCustomTokenExchange, customTokenExchange: customTokenExchange, exchangeToken: exchangeToken, loginWithRedirect: loginWithRedirect, loginWithPopup: loginWithPopup, connectAccountWithRedirect: connectAccountWithRedirect, logout: logout, revokeRefreshToken: revokeRefreshToken, handleRedirectCallback: handleRedirectCallback, getDpopNonce: getDpopNonce, setDpopNonce: setDpopNonce, generateDpopProof: generateDpopProof, createFetcher: createFetcher, getConfiguration: getConfiguration, mfa: mfa, passkey: passkey, myAccount: myAccount });
|
|
584
587
|
}, [
|
|
585
588
|
state,
|
|
586
589
|
getAccessTokenSilently,
|
|
@@ -593,6 +596,7 @@ var Auth0Provider = function (opts) {
|
|
|
593
596
|
loginWithPopup,
|
|
594
597
|
connectAccountWithRedirect,
|
|
595
598
|
logout,
|
|
599
|
+
revokeRefreshToken,
|
|
596
600
|
handleRedirectCallback,
|
|
597
601
|
getDpopNonce,
|
|
598
602
|
setDpopNonce,
|