@dexteel/mesf-core 3.10.4 → 3.10.5
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/index.esm.js +10 -6
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -5461,7 +5461,6 @@ var AuthContext = React__default.createContext({});
|
|
|
5461
5461
|
var AuthProvider = function (_a) {
|
|
5462
5462
|
var children = _a.children, authConfig = _a.authConfig;
|
|
5463
5463
|
var useTokenHook = useToken();
|
|
5464
|
-
console.log(useTokenHook.token);
|
|
5465
5464
|
return (React__default.createElement(React__default.Fragment, null,
|
|
5466
5465
|
React__default.createElement(AuthContext.Provider, { value: useTokenHook },
|
|
5467
5466
|
!!useTokenHook.token && React__default.createElement(Authenticated, null, children),
|
|
@@ -5473,7 +5472,15 @@ var Authenticated = function (_a) {
|
|
|
5473
5472
|
};
|
|
5474
5473
|
var Unauthenticated = function (_a) {
|
|
5475
5474
|
var authConfig = _a.authConfig;
|
|
5476
|
-
|
|
5475
|
+
var clearUserData = useContext(AuthContext).clearUserData;
|
|
5476
|
+
var params = useRef((new URL(document.location)).searchParams);
|
|
5477
|
+
useEffect(function () {
|
|
5478
|
+
clearUserData();
|
|
5479
|
+
var newUrl = window.location.origin
|
|
5480
|
+
+ '?' + params.current.toString();
|
|
5481
|
+
window.history.replaceState({ path: newUrl }, '', newUrl);
|
|
5482
|
+
}, []);
|
|
5483
|
+
return React__default.createElement(Login, { authConfig: authConfig });
|
|
5477
5484
|
};
|
|
5478
5485
|
|
|
5479
5486
|
var LoginWithEmailAndPassword = function () {
|
|
@@ -5678,7 +5685,6 @@ function Login(_a) {
|
|
|
5678
5685
|
setOpen(false);
|
|
5679
5686
|
params.current["delete"]('message');
|
|
5680
5687
|
var newUrl = window.location.origin
|
|
5681
|
-
+ window.location.pathname
|
|
5682
5688
|
+ '?' + params.current.toString();
|
|
5683
5689
|
window.history.replaceState({ path: newUrl }, '', newUrl);
|
|
5684
5690
|
};
|
|
@@ -5710,9 +5716,7 @@ function Logout() {
|
|
|
5710
5716
|
var _a = useSearchParams(), params = _a[0]; _a[1];
|
|
5711
5717
|
var logout = function () {
|
|
5712
5718
|
clearUserData();
|
|
5713
|
-
|
|
5714
|
-
navigate("/?".concat(params.toString()));
|
|
5715
|
-
}, 0);
|
|
5719
|
+
navigate("/?".concat(params.toString()));
|
|
5716
5720
|
};
|
|
5717
5721
|
useEffect(function () {
|
|
5718
5722
|
logout();
|