@larose-ui/enterprise 0.1.1 → 0.2.0
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.js +4 -2
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -331,6 +331,7 @@ function SensitiveAction({
|
|
|
331
331
|
|
|
332
332
|
// src/security/SessionGuard.tsx
|
|
333
333
|
import { useCallback as useCallback3, useEffect, useState as useState4 } from "react";
|
|
334
|
+
import { isSafeRedirectPath } from "@larose-ui/core";
|
|
334
335
|
import { Dialog as Dialog2 } from "@larose-ui/react";
|
|
335
336
|
import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
336
337
|
function SessionGuard({
|
|
@@ -347,11 +348,12 @@ function SessionGuard({
|
|
|
347
348
|
window.addEventListener("larose:session-expired", handler);
|
|
348
349
|
return () => window.removeEventListener("larose:session-expired", handler);
|
|
349
350
|
}, []);
|
|
351
|
+
const safeLoginUrl = isSafeRedirectPath(loginUrl) ? loginUrl : "/login";
|
|
350
352
|
const handleRedirect = useCallback3(() => {
|
|
351
353
|
const returnUrl = window.location.pathname + window.location.search;
|
|
352
354
|
onSessionExpired?.(returnUrl);
|
|
353
|
-
window.location.href = `${
|
|
354
|
-
}, [
|
|
355
|
+
window.location.href = `${safeLoginUrl}?returnUrl=${encodeURIComponent(returnUrl)}`;
|
|
356
|
+
}, [safeLoginUrl, onSessionExpired]);
|
|
355
357
|
return /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
356
358
|
children,
|
|
357
359
|
/* @__PURE__ */ jsx7(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@larose-ui/enterprise",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Enterprise features — audit trails, version compatibility, UI schema IaC, security patterns",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"README.md"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@larose-ui/core": "0.
|
|
21
|
-
"@larose-ui/forms": "0.1.
|
|
22
|
-
"@larose-ui/observability": "0.
|
|
23
|
-
"@larose-ui/permissions": "0.
|
|
24
|
-
"@larose-ui/react": "0.
|
|
25
|
-
"@larose-ui/runtime": "0.
|
|
20
|
+
"@larose-ui/core": "0.2.0",
|
|
21
|
+
"@larose-ui/forms": "0.1.3",
|
|
22
|
+
"@larose-ui/observability": "0.2.0",
|
|
23
|
+
"@larose-ui/permissions": "0.2.0",
|
|
24
|
+
"@larose-ui/react": "0.2.0",
|
|
25
|
+
"@larose-ui/runtime": "1.0.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": ">=18"
|