@veripass/react-sdk 1.0.15 → 1.0.17
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 +20 -8
- package/dist/react-sdk.cjs.js.map +1 -1
- package/dist/react-sdk.esm.js +20 -8
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/react-sdk.cjs.js
CHANGED
|
@@ -593,15 +593,27 @@ var AuthProvider = function AuthProvider(_ref) {
|
|
|
593
593
|
user = _useLocalStorage2[0],
|
|
594
594
|
setUser = _useLocalStorage2[1];
|
|
595
595
|
React.useEffect(function () {
|
|
596
|
-
|
|
596
|
+
var publicPaths = new Set(defaultPublicUrlList);
|
|
597
|
+
var extractPublicPaths = function extractPublicPaths(child) {
|
|
598
|
+
var parentPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
599
|
+
if (/*#__PURE__*/React.isValidElement(child)) {
|
|
600
|
+
var currentPath = "".concat(parentPath).concat(child.props.path || '');
|
|
601
|
+
if (child.props.isPublic) {
|
|
602
|
+
publicPaths.add(currentPath);
|
|
603
|
+
}
|
|
604
|
+
if (child.props.children) {
|
|
605
|
+
React.Children.forEach(child.props.children, function (grandchild) {
|
|
606
|
+
return extractPublicPaths(grandchild, currentPath);
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
};
|
|
611
|
+
React.Children.forEach(children, function (child) {
|
|
612
|
+
return extractPublicPaths(child);
|
|
613
|
+
});
|
|
614
|
+
debugger;
|
|
615
|
+
setPublicPathSet(publicPaths);
|
|
597
616
|
}, [children]);
|
|
598
|
-
React.Children.forEach(children, function (child) {
|
|
599
|
-
// Check if child is a valid React element
|
|
600
|
-
if (/*#__PURE__*/React.isValidElement(child) && child.props.isPublic) {
|
|
601
|
-
debugger;
|
|
602
|
-
publicPaths.add(child.props.path); // Assumes `path` is passed as prop
|
|
603
|
-
}
|
|
604
|
-
});
|
|
605
617
|
|
|
606
618
|
/**
|
|
607
619
|
* Logs in the user by saving their data to local storage and navigating to the admin page.
|