@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.
- package/dist/react-sdk.cjs.js +6 -22
- package/dist/react-sdk.cjs.js.map +1 -1
- package/dist/react-sdk.esm.js +6 -22
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/react-sdk.esm.js
CHANGED
|
@@ -10,9 +10,6 @@ function _arrayLikeToArray(r, a) {
|
|
|
10
10
|
function _arrayWithHoles(r) {
|
|
11
11
|
if (Array.isArray(r)) return r;
|
|
12
12
|
}
|
|
13
|
-
function _arrayWithoutHoles(r) {
|
|
14
|
-
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
15
|
-
}
|
|
16
13
|
function _assertThisInitialized$1(e) {
|
|
17
14
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
18
15
|
return e;
|
|
@@ -101,9 +98,6 @@ function _isNativeReflectConstruct() {
|
|
|
101
98
|
return !!t;
|
|
102
99
|
})();
|
|
103
100
|
}
|
|
104
|
-
function _iterableToArray(r) {
|
|
105
|
-
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
106
|
-
}
|
|
107
101
|
function _iterableToArrayLimit(r, l) {
|
|
108
102
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
109
103
|
if (null != t) {
|
|
@@ -134,9 +128,6 @@ function _iterableToArrayLimit(r, l) {
|
|
|
134
128
|
function _nonIterableRest() {
|
|
135
129
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
136
130
|
}
|
|
137
|
-
function _nonIterableSpread() {
|
|
138
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
139
|
-
}
|
|
140
131
|
function ownKeys(e, r) {
|
|
141
132
|
var t = Object.keys(e);
|
|
142
133
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -483,9 +474,6 @@ function _taggedTemplateLiteral(e, t) {
|
|
|
483
474
|
}
|
|
484
475
|
}));
|
|
485
476
|
}
|
|
486
|
-
function _toConsumableArray(r) {
|
|
487
|
-
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
488
|
-
}
|
|
489
477
|
function _toPrimitive(t, r) {
|
|
490
478
|
if ("object" != typeof t || !t) return t;
|
|
491
479
|
var e = t[Symbol.toPrimitive];
|
|
@@ -559,10 +547,8 @@ var AuthContext = /*#__PURE__*/createContext();
|
|
|
559
547
|
* @returns {JSX.Element} The provider component for AuthContext.
|
|
560
548
|
*/
|
|
561
549
|
var AuthProvider = function AuthProvider(_ref) {
|
|
562
|
-
var children = _ref.children
|
|
563
|
-
|
|
564
|
-
publicUrls = _ref$publicUrls === void 0 ? [] : _ref$publicUrls;
|
|
565
|
-
var _useState = useState(defaultPublicUrlList),
|
|
550
|
+
var children = _ref.children;
|
|
551
|
+
var _useState = useState(),
|
|
566
552
|
_useState2 = _slicedToArray(_useState, 2),
|
|
567
553
|
publicUrlsList = _useState2[0],
|
|
568
554
|
setPublicUrlsList = _useState2[1];
|
|
@@ -643,18 +629,16 @@ var AuthProvider = function AuthProvider(_ref) {
|
|
|
643
629
|
return JSON.parse(value);
|
|
644
630
|
};
|
|
645
631
|
|
|
646
|
-
// Effect to update public URLs whenever publicUrls prop changes
|
|
647
|
-
useEffect(function () {
|
|
648
|
-
setPublicUrlsList([].concat(defaultPublicUrlList, _toConsumableArray(publicUrls)));
|
|
649
|
-
}, [publicUrls]);
|
|
650
|
-
|
|
651
632
|
// Effect to redirect if user is null
|
|
652
633
|
useEffect(function () {
|
|
653
634
|
if (isInitialized) {
|
|
654
635
|
var currentPath = window.location.pathname;
|
|
655
636
|
var isWhitelisted = publicUrlsList.includes(currentPath);
|
|
656
637
|
if (user === null && !isWhitelisted) {
|
|
657
|
-
|
|
638
|
+
console.log(publicUrlsList);
|
|
639
|
+
console.log(currentPath);
|
|
640
|
+
debugger;
|
|
641
|
+
//window.location.replace('/auth/login');
|
|
658
642
|
}
|
|
659
643
|
}
|
|
660
644
|
}, [user, publicUrlsList, isInitialized]);
|