@larose-ui/enterprise 0.1.1 → 0.1.2

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -2
  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 = `${loginUrl}?returnUrl=${encodeURIComponent(returnUrl)}`;
354
- }, [loginUrl, onSessionExpired]);
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.1.1",
3
+ "version": "0.1.2",
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.1.1",
21
- "@larose-ui/forms": "0.1.1",
22
- "@larose-ui/observability": "0.1.1",
23
- "@larose-ui/permissions": "0.1.1",
24
- "@larose-ui/react": "0.1.1",
25
- "@larose-ui/runtime": "0.1.1"
20
+ "@larose-ui/core": "0.1.2",
21
+ "@larose-ui/forms": "0.1.2",
22
+ "@larose-ui/observability": "0.1.2",
23
+ "@larose-ui/permissions": "0.1.2",
24
+ "@larose-ui/react": "0.1.2",
25
+ "@larose-ui/runtime": "0.1.2"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": ">=18"