@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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Auth0",
3
3
  "name": "@auth0/auth0-react",
4
- "version": "1.10.0",
4
+ "version": "1.10.1",
5
5
  "description": "Auth0 SDK for React Single Page Applications (SPA)",
6
6
  "keywords": [
7
7
  "auth0",
@@ -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) {