@auth0/auth0-react 1.10.0 → 1.10.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/dist/auth0-provider.d.ts.map +1 -1
- package/dist/auth0-react.cjs.js +6 -1
- package/dist/auth0-react.cjs.js.map +1 -1
- package/dist/auth0-react.esm.js +7 -2
- package/dist/auth0-react.esm.js.map +1 -1
- package/dist/auth0-react.js +6 -1
- 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/package.json +1 -1
- package/src/auth0-provider.tsx +6 -0
package/package.json
CHANGED
package/src/auth0-provider.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import React, {
|
|
|
3
3
|
useEffect,
|
|
4
4
|
useMemo,
|
|
5
5
|
useReducer,
|
|
6
|
+
useRef,
|
|
6
7
|
useState,
|
|
7
8
|
} from 'react';
|
|
8
9
|
import {
|
|
@@ -240,8 +241,13 @@ const Auth0Provider = (opts: Auth0ProviderOptions): JSX.Element => {
|
|
|
240
241
|
() => new Auth0Client(toAuth0ClientOptions(clientOpts))
|
|
241
242
|
);
|
|
242
243
|
const [state, dispatch] = useReducer(reducer, initialAuthState);
|
|
244
|
+
const didInitialise = useRef(false);
|
|
243
245
|
|
|
244
246
|
useEffect(() => {
|
|
247
|
+
if (didInitialise.current) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
didInitialise.current = true;
|
|
245
251
|
(async (): Promise<void> => {
|
|
246
252
|
try {
|
|
247
253
|
if (hasAuthParams() && !skipRedirectCallback) {
|