@plasmicapp/react-web 0.2.162 → 0.2.164
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-web.cjs.development.js +10 -3
- package/dist/react-web.cjs.development.js.map +1 -1
- package/dist/react-web.cjs.production.min.js +1 -1
- package/dist/react-web.cjs.production.min.js.map +1 -1
- package/dist/react-web.esm.js +10 -3
- package/dist/react-web.esm.js.map +1 -1
- package/package.json +4 -4
- package/skinny/dist/index.js +12 -3
- package/skinny/dist/index.js.map +1 -1
package/dist/react-web.esm.js
CHANGED
|
@@ -773,6 +773,13 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
773
773
|
}
|
|
774
774
|
});
|
|
775
775
|
|
|
776
|
+
// https://stackoverflow.com/a/2117523
|
|
777
|
+
function uuidv4() {
|
|
778
|
+
// @ts-ignore
|
|
779
|
+
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, function (c) {
|
|
780
|
+
return (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16);
|
|
781
|
+
});
|
|
782
|
+
}
|
|
776
783
|
function triggerLogin(_x, _x2) {
|
|
777
784
|
return _triggerLogin.apply(this, arguments);
|
|
778
785
|
}
|
|
@@ -817,7 +824,7 @@ function _triggerLogin() {
|
|
|
817
824
|
state = JSON.stringify({
|
|
818
825
|
continueTo: continueTo
|
|
819
826
|
});
|
|
820
|
-
code_verifier =
|
|
827
|
+
code_verifier = uuidv4();
|
|
821
828
|
localStorage.setItem("code_verifier", code_verifier);
|
|
822
829
|
_context2.next = 8;
|
|
823
830
|
return sha256(code_verifier);
|
|
@@ -849,11 +856,11 @@ function PlasmicPageGuard(props) {
|
|
|
849
856
|
var dataSourceCtxValue = usePlasmicDataSourceContext();
|
|
850
857
|
React__default.useEffect(function () {
|
|
851
858
|
if (canTriggerLogin) {
|
|
852
|
-
if (dataSourceCtxValue && "isUserLoading" in dataSourceCtxValue && !dataSourceCtxValue.isUserLoading && !dataSourceCtxValue.user) {
|
|
859
|
+
if (minRole && dataSourceCtxValue && "isUserLoading" in dataSourceCtxValue && !dataSourceCtxValue.isUserLoading && !dataSourceCtxValue.user) {
|
|
853
860
|
triggerLogin(appId, authorizeEndpoint);
|
|
854
861
|
}
|
|
855
862
|
}
|
|
856
|
-
}, [dataSourceCtxValue, appId, authorizeEndpoint, canTriggerLogin]);
|
|
863
|
+
}, [dataSourceCtxValue, appId, authorizeEndpoint, canTriggerLogin, minRole]);
|
|
857
864
|
function canUserViewPage() {
|
|
858
865
|
if (!minRole) {
|
|
859
866
|
return true;
|