@veripass/react-sdk 1.0.20 → 1.0.22

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.
@@ -30,9 +30,6 @@ function _arrayLikeToArray(r, a) {
30
30
  function _arrayWithHoles(r) {
31
31
  if (Array.isArray(r)) return r;
32
32
  }
33
- function _arrayWithoutHoles(r) {
34
- if (Array.isArray(r)) return _arrayLikeToArray(r);
35
- }
36
33
  function _assertThisInitialized$1(e) {
37
34
  if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
38
35
  return e;
@@ -121,9 +118,6 @@ function _isNativeReflectConstruct() {
121
118
  return !!t;
122
119
  })();
123
120
  }
124
- function _iterableToArray(r) {
125
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
126
- }
127
121
  function _iterableToArrayLimit(r, l) {
128
122
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
129
123
  if (null != t) {
@@ -154,9 +148,6 @@ function _iterableToArrayLimit(r, l) {
154
148
  function _nonIterableRest() {
155
149
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
156
150
  }
157
- function _nonIterableSpread() {
158
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
159
- }
160
151
  function ownKeys(e, r) {
161
152
  var t = Object.keys(e);
162
153
  if (Object.getOwnPropertySymbols) {
@@ -503,9 +494,6 @@ function _taggedTemplateLiteral(e, t) {
503
494
  }
504
495
  }));
505
496
  }
506
- function _toConsumableArray(r) {
507
- return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
508
- }
509
497
  function _toPrimitive(t, r) {
510
498
  if ("object" != typeof t || !t) return t;
511
499
  var e = t[Symbol.toPrimitive];
@@ -579,10 +567,8 @@ var AuthContext = /*#__PURE__*/React.createContext();
579
567
  * @returns {JSX.Element} The provider component for AuthContext.
580
568
  */
581
569
  var AuthProvider = function AuthProvider(_ref) {
582
- var children = _ref.children,
583
- _ref$publicUrls = _ref.publicUrls,
584
- publicUrls = _ref$publicUrls === void 0 ? [] : _ref$publicUrls;
585
- var _useState = React.useState(defaultPublicUrlList),
570
+ var children = _ref.children;
571
+ var _useState = React.useState(),
586
572
  _useState2 = _slicedToArray(_useState, 2),
587
573
  publicUrlsList = _useState2[0],
588
574
  setPublicUrlsList = _useState2[1];
@@ -663,18 +649,16 @@ var AuthProvider = function AuthProvider(_ref) {
663
649
  return JSON.parse(value);
664
650
  };
665
651
 
666
- // Effect to update public URLs whenever publicUrls prop changes
667
- React.useEffect(function () {
668
- setPublicUrlsList([].concat(defaultPublicUrlList, _toConsumableArray(publicUrls)));
669
- }, [publicUrls]);
670
-
671
652
  // Effect to redirect if user is null
672
653
  React.useEffect(function () {
673
654
  if (isInitialized) {
674
655
  var currentPath = window.location.pathname;
675
656
  var isWhitelisted = publicUrlsList.includes(currentPath);
676
657
  if (user === null && !isWhitelisted) {
677
- window.location.replace('/auth/login');
658
+ console.log(publicUrlsList);
659
+ console.log(currentPath);
660
+ debugger;
661
+ //window.location.replace('/auth/login');
678
662
  }
679
663
  }
680
664
  }, [user, publicUrlsList, isInitialized]);