@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.
@@ -1,4 +1,4 @@
1
- import React, { createContext, useState, useReducer, useEffect, useCallback, useMemo, useContext } from 'react';
1
+ import React, { createContext, useState, useReducer, useRef, useEffect, useCallback, useMemo, useContext } from 'react';
2
2
 
3
3
  /*! *****************************************************************************
4
4
  Copyright (c) Microsoft Corporation.
@@ -199,7 +199,7 @@ var toAuth0ClientOptions = function (opts) {
199
199
  var clientId = opts.clientId, redirectUri = opts.redirectUri, maxAge = opts.maxAge, validOpts = __rest(opts, ["clientId", "redirectUri", "maxAge"]);
200
200
  return __assign(__assign({}, validOpts), { client_id: clientId, redirect_uri: redirectUri, max_age: maxAge, auth0Client: {
201
201
  name: 'auth0-react',
202
- version: '1.10.0',
202
+ version: '1.10.1',
203
203
  } });
204
204
  };
205
205
  /**
@@ -234,7 +234,12 @@ var Auth0Provider = function (opts) {
234
234
  var children = opts.children, skipRedirectCallback = opts.skipRedirectCallback, _a = opts.onRedirectCallback, onRedirectCallback = _a === void 0 ? defaultOnRedirectCallback : _a, clientOpts = __rest(opts, ["children", "skipRedirectCallback", "onRedirectCallback"]);
235
235
  var client = useState(function () { return new hc(toAuth0ClientOptions(clientOpts)); })[0];
236
236
  var _b = useReducer(reducer, initialAuthState), state = _b[0], dispatch = _b[1];
237
+ var didInitialise = useRef(false);
237
238
  useEffect(function () {
239
+ if (didInitialise.current) {
240
+ return;
241
+ }
242
+ didInitialise.current = true;
238
243
  (function () { return __awaiter(void 0, void 0, void 0, function () {
239
244
  var appState, user, error_1;
240
245
  return __generator(this, function (_a) {