@burdenoff/microfe-auth 2026.830.1 → 2026.904.1
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/auth/AuthRoot.js +43 -41
- package/dist/auth/AuthRoot.js.map +1 -1
- package/dist/auth/AuthRoutes.js +7 -0
- package/dist/auth/AuthRoutes.js.map +1 -1
- package/dist/auth/components/AuthLayout.js +65 -67
- package/dist/auth/components/AuthLayout.js.map +1 -1
- package/dist/auth/components/CaptchaV2.js +21 -24
- package/dist/auth/components/CaptchaV2.js.map +1 -1
- package/dist/auth/components/ConfirmActionDialog.js +33 -32
- package/dist/auth/components/ConfirmActionDialog.js.map +1 -1
- package/dist/auth/components/profile/UserProfileMenu.js +44 -46
- package/dist/auth/components/profile/UserProfileMenu.js.map +1 -1
- package/dist/auth/components/workspace/WorkspaceSelector.js +62 -68
- package/dist/auth/components/workspace/WorkspaceSelector.js.map +1 -1
- package/dist/auth/pages/AuditLogPage.js +65 -68
- package/dist/auth/pages/AuditLogPage.js.map +1 -1
- package/dist/auth/pages/EmailVerifyPage.js +51 -54
- package/dist/auth/pages/EmailVerifyPage.js.map +1 -1
- package/dist/auth/pages/LoginPage.js +223 -225
- package/dist/auth/pages/LoginPage.js.map +1 -1
- package/dist/auth/pages/MagicLinkPage.js +67 -69
- package/dist/auth/pages/MagicLinkPage.js.map +1 -1
- package/dist/auth/pages/MfaSetupPage.js +85 -88
- package/dist/auth/pages/MfaSetupPage.js.map +1 -1
- package/dist/auth/pages/MfaVerifyPage.js +60 -63
- package/dist/auth/pages/MfaVerifyPage.js.map +1 -1
- package/dist/auth/pages/OAuthCallbackPage.js +37 -40
- package/dist/auth/pages/OAuthCallbackPage.js.map +1 -1
- package/dist/auth/pages/PasswordResetPage.js +102 -105
- package/dist/auth/pages/PasswordResetPage.js.map +1 -1
- package/dist/auth/pages/ReactivatePage.js +54 -57
- package/dist/auth/pages/ReactivatePage.js.map +1 -1
- package/dist/auth/pages/RegisterPage.js +171 -174
- package/dist/auth/pages/RegisterPage.js.map +1 -1
- package/dist/auth/pages/SSOClearPage.js +21 -20
- package/dist/auth/pages/SSOClearPage.js.map +1 -1
- package/dist/auth/pages/SSODepositPage.js +27 -26
- package/dist/auth/pages/SSODepositPage.js.map +1 -1
- package/dist/auth/pages/SSORelayCallbackPage.js +19 -18
- package/dist/auth/pages/SSORelayCallbackPage.js.map +1 -1
- package/dist/auth/pages/SecurityPage.js +247 -250
- package/dist/auth/pages/SecurityPage.js.map +1 -1
- package/dist/auth/pages/SessionsPage.js +95 -98
- package/dist/auth/pages/SessionsPage.js.map +1 -1
- package/dist/auth/pages/SsoCallbackPage.js +53 -56
- package/dist/auth/pages/SsoCallbackPage.js.map +1 -1
- package/dist/auth/pages/SsoConfigPage.js +296 -299
- package/dist/auth/pages/SsoConfigPage.js.map +1 -1
- package/dist/auth/pages/SsoLoginPage.js +65 -68
- package/dist/auth/pages/SsoLoginPage.js.map +1 -1
- package/dist/auth/pages/UserDetailsPage.js +124 -127
- package/dist/auth/pages/UserDetailsPage.js.map +1 -1
- package/dist/auth/pages/UserProfilePage.js +171 -174
- package/dist/auth/pages/UserProfilePage.js.map +1 -1
- package/dist/auth/pages/UsersPage.js +322 -325
- package/dist/auth/pages/UsersPage.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/shared/hooks/index.d.ts +1 -6
- package/dist/shared/hooks/useTr.d.ts +16 -0
- package/dist/shared/hooks/useTr.js +14 -0
- package/dist/shared/hooks/useTr.js.map +1 -0
- package/dist/translations/en.d.ts +806 -248
- package/dist/translations/en.js +870 -0
- package/dist/translations/en.js.map +1 -0
- package/package.json +1 -1
package/dist/auth/AuthRoot.js
CHANGED
|
@@ -1,83 +1,85 @@
|
|
|
1
1
|
import { AuthProvider as e } from "./providers/AuthProvider.js";
|
|
2
2
|
import { CaptchaProvider as t } from "./providers/CaptchaProvider.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
3
|
+
import { useTr as n } from "../shared/hooks/useTr.js";
|
|
4
|
+
import { AuthRoutes as r } from "./AuthRoutes.js";
|
|
5
|
+
import { useEffect as i, useMemo as a } from "react";
|
|
6
|
+
import { ErrorBoundary as o } from "@burdenoff/fe-libs/shared/components";
|
|
7
|
+
import { useLocation as s } from "react-router";
|
|
8
|
+
import { Building as c, Key as l, Laptop as u, ShieldCheck as d } from "lucide-react";
|
|
9
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
10
|
+
import { FeatureFlagProvider as p } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
10
11
|
//#region src/auth/AuthRoot.tsx
|
|
11
|
-
var
|
|
12
|
-
let { registerNavItems:
|
|
13
|
-
return
|
|
14
|
-
if (
|
|
12
|
+
var m = (m) => {
|
|
13
|
+
let { registerNavItems: h, registerFooterItems: g, basePath: _ = "/", enableAdminRoutes: v = !1, bypassEnterprisePlanGate: y = !1 } = m, b = n(), x = s(), S = a(() => _ && _ !== "/" ? _.endsWith("/") ? _.slice(0, -1) : _ : "", [_]), C = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
|
|
14
|
+
return i(() => {
|
|
15
|
+
if (h) return h([
|
|
15
16
|
{
|
|
16
17
|
id: "auth-security",
|
|
17
|
-
label: "Security Settings",
|
|
18
|
-
path:
|
|
19
|
-
icon: /* @__PURE__ */ d
|
|
18
|
+
label: b("auth.root.navSecurity", "Security Settings"),
|
|
19
|
+
path: C(_, "security"),
|
|
20
|
+
icon: /* @__PURE__ */ f(d, { size: 20 }),
|
|
20
21
|
order: 10,
|
|
21
22
|
group: "auth"
|
|
22
23
|
},
|
|
23
24
|
{
|
|
24
25
|
id: "auth-sessions",
|
|
25
|
-
label: "Active Sessions",
|
|
26
|
-
path:
|
|
27
|
-
icon: /* @__PURE__ */
|
|
26
|
+
label: b("auth.root.navSessions", "Active Sessions"),
|
|
27
|
+
path: C(_, "sessions"),
|
|
28
|
+
icon: /* @__PURE__ */ f(u, { size: 20 }),
|
|
28
29
|
order: 20,
|
|
29
30
|
group: "auth"
|
|
30
31
|
},
|
|
31
32
|
{
|
|
32
33
|
id: "auth-mfa",
|
|
33
|
-
label: "Multi-Factor Auth",
|
|
34
|
-
path:
|
|
35
|
-
icon: /* @__PURE__ */
|
|
34
|
+
label: b("auth.root.navMfa", "Multi-Factor Auth"),
|
|
35
|
+
path: C(_, "mfa"),
|
|
36
|
+
icon: /* @__PURE__ */ f(l, { size: 20 }),
|
|
36
37
|
order: 30,
|
|
37
38
|
group: "auth"
|
|
38
39
|
},
|
|
39
|
-
...
|
|
40
|
+
...v ? [{
|
|
40
41
|
id: "auth-sso",
|
|
41
|
-
label: "SSO Configuration",
|
|
42
|
-
path:
|
|
43
|
-
icon: /* @__PURE__ */
|
|
42
|
+
label: b("auth.root.navSso", "SSO Configuration"),
|
|
43
|
+
path: C(_, "sso"),
|
|
44
|
+
icon: /* @__PURE__ */ f(c, { size: 20 }),
|
|
44
45
|
order: 50,
|
|
45
46
|
group: "auth"
|
|
46
47
|
}] : []
|
|
47
48
|
]);
|
|
48
49
|
}, [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
h,
|
|
51
|
+
_,
|
|
52
|
+
v,
|
|
53
|
+
b
|
|
54
|
+
]), i(() => {
|
|
55
|
+
if (g) return g([{
|
|
54
56
|
id: "auth-status",
|
|
55
|
-
label: "Auth Ready",
|
|
57
|
+
label: b("auth.root.footerReady", "Auth Ready"),
|
|
56
58
|
type: "status",
|
|
57
59
|
order: 10,
|
|
58
60
|
section: "left"
|
|
59
61
|
}]);
|
|
60
|
-
}, [
|
|
61
|
-
fallback: /* @__PURE__ */
|
|
62
|
+
}, [g, b]), a(() => S ? x.pathname === S || x.pathname.startsWith(S + "/") : !0, [S, x.pathname]) ? /* @__PURE__ */ f(o, {
|
|
63
|
+
fallback: /* @__PURE__ */ f("div", {
|
|
62
64
|
className: "p-6 text-center text-text-secondary",
|
|
63
|
-
children: "Something went wrong loading this module. Please refresh the page."
|
|
65
|
+
children: b("auth.root.loadError", "Something went wrong loading this module. Please refresh the page.")
|
|
64
66
|
}),
|
|
65
|
-
children: /* @__PURE__ */
|
|
67
|
+
children: /* @__PURE__ */ f(p, {
|
|
66
68
|
workspaceId: null,
|
|
67
69
|
gateway: "global",
|
|
68
70
|
defaultEnabled: !0,
|
|
69
|
-
children: /* @__PURE__ */
|
|
70
|
-
...
|
|
71
|
-
children: /* @__PURE__ */
|
|
72
|
-
basePath:
|
|
73
|
-
enableAdminRoutes:
|
|
74
|
-
bypassEnterprisePlanGate:
|
|
71
|
+
children: /* @__PURE__ */ f(e, {
|
|
72
|
+
...m,
|
|
73
|
+
children: /* @__PURE__ */ f(t, { children: /* @__PURE__ */ f(r, {
|
|
74
|
+
basePath: S,
|
|
75
|
+
enableAdminRoutes: v,
|
|
76
|
+
bypassEnterprisePlanGate: y
|
|
75
77
|
}) })
|
|
76
78
|
})
|
|
77
79
|
})
|
|
78
80
|
}) : null;
|
|
79
81
|
};
|
|
80
82
|
//#endregion
|
|
81
|
-
export {
|
|
83
|
+
export { m as AuthRoot };
|
|
82
84
|
|
|
83
85
|
//# sourceMappingURL=AuthRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthRoot.js","names":[],"sources":["../../src/auth/AuthRoot.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useEffect, useMemo } from \"react\";\nimport { ErrorBoundary } from \"@burdenoff/fe-libs/shared/components\";\nimport { useLocation } from \"react-router\";\nimport { ShieldCheck, Laptop, Key, /* Code, */ Building } from \"lucide-react\";\nimport { AuthProvider } from \"./providers/AuthProvider\";\nimport { FeatureFlagProvider } from \"@burdenoff/fe-libs/shared/feature-flags\";\nimport { CaptchaProvider } from \"./providers/CaptchaProvider\";\nimport type { NavItem, AuthRootProps } from \"./types\";\nimport { AuthRoutes } from \"./AuthRoutes\";\n\n/**\n * Root component for the Auth microfrontend.\n *\n * This is the main entry point that host applications import and render.\n * It sets up the necessary providers and renders the internal routing.\n * Automatically registers navigation items with the shell if registration functions are provided.\n *\n * @example\n * ```tsx\n * import { AuthRoot, type AuthRootProps } from '@burdenoff/microfe-auth';\n *\n * function App() {\n * const props: AuthRootProps = {\n * basePath: '/auth',\n * navigate: (path) => router.push(path),\n * apiGatewayUrl: 'http://localhost:4002',\n * authToken: 'token',\n * onAuthSuccess: (user) => shellLogin(user),\n * onLogout: () => shellLogout(),\n * };\n *\n * return <AuthRoot {...props} />;\n * }\n * ```\n */\nexport const AuthRoot: FC<AuthRootProps> = (props) => {\n const {\n registerNavItems,\n registerFooterItems,\n basePath = \"/\",\n // Admin routes (`/auth/users`, `/auth/users/:id`, `/auth/sso`,\n // `/auth/audit-log`) are opt-in: only the admin app shell should pass\n // `enableAdminRoutes={true}`. User-facing product hosts (vibecontrols,\n // workspaces, botlit, healthybowl, etc.) intentionally do not expose\n // these surfaces — gateway RBAC still gates the underlying\n // queries/mutations, but hiding the routes prevents accidental UI\n // discoverability. Must match the corresponding default in\n // `AuthRoutes.tsx`.\n enableAdminRoutes = false,\n bypassEnterprisePlanGate = false,\n } = props;\n const location = useLocation();\n\n // Normalize basePath (remove trailing slash)\n const normalizedBasePath = useMemo(\n () =>\n basePath && basePath !== \"/\"\n ? basePath.endsWith(\"/\")\n ? basePath.slice(0, -1)\n : basePath\n : \"\",\n [basePath],\n );\n\n // Helper to join paths correctly, avoiding double slashes\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith(\"/\") ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith(\"/\") ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with the shell\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: \"auth-security\",\n label: \"Security Settings\",\n path: joinPath(basePath, \"security\"),\n icon: <ShieldCheck size={20} />,\n order: 10,\n group: \"auth\",\n },\n {\n id: \"auth-sessions\",\n label: \"Active Sessions\",\n path: joinPath(basePath, \"sessions\"),\n icon: <Laptop size={20} />,\n order: 20,\n group: \"auth\",\n },\n {\n id: \"auth-mfa\",\n label: \"Multi-Factor Auth\",\n path: joinPath(basePath, \"mfa\"),\n icon: <Key size={20} />,\n order: 30,\n group: \"auth\",\n },\n // Hidden — moved to Developer Portal\n // {\n // id: \"auth-api-keys\",\n // label: \"API Keys\",\n // path: joinPath(basePath, \"api-keys\"),\n // icon: <Code size={20} />,\n // order: 40,\n // group: \"auth\",\n // },\n ...(enableAdminRoutes\n ? [\n {\n id: \"auth-sso\",\n label: \"SSO Configuration\",\n path: joinPath(basePath, \"sso\"),\n icon: <Building size={20} />,\n order: 50,\n group: \"auth\",\n },\n ]\n : []),\n ];\n\n // Register and get cleanup function\n const cleanup = registerNavItems(navItems);\n\n // Return cleanup function to unregister on unmount\n return cleanup;\n }, [registerNavItems, basePath, enableAdminRoutes]);\n\n // Register footer items (example: auth status indicator)\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: \"auth-status\",\n label: \"Auth Ready\",\n type: \"status\" as const,\n order: 10,\n section: \"left\" as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems]);\n\n // Check if path matches - must be after all hooks\n const pathMatches = useMemo(() => {\n if (!normalizedBasePath) return true;\n return (\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + \"/\")\n );\n }, [normalizedBasePath, location.pathname]);\n\n // Early return after all hooks are called\n if (!pathMatches) {\n return null;\n }\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n Something went wrong loading this module. Please refresh the page.\n </div>\n }\n >\n <FeatureFlagProvider\n workspaceId={null}\n gateway=\"global\"\n defaultEnabled={true}\n >\n <AuthProvider {...props}>\n <CaptchaProvider>\n <AuthRoutes\n basePath={normalizedBasePath}\n enableAdminRoutes={enableAdminRoutes}\n bypassEnterprisePlanGate={bypassEnterprisePlanGate}\n />\n </CaptchaProvider>\n </AuthProvider>\n </FeatureFlagProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuthRoot.js","names":[],"sources":["../../src/auth/AuthRoot.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useEffect, useMemo } from \"react\";\nimport { ErrorBoundary } from \"@burdenoff/fe-libs/shared/components\";\nimport { useLocation } from \"react-router\";\nimport { ShieldCheck, Laptop, Key, /* Code, */ Building } from \"lucide-react\";\nimport { AuthProvider } from \"./providers/AuthProvider\";\nimport { FeatureFlagProvider } from \"@burdenoff/fe-libs/shared/feature-flags\";\nimport { CaptchaProvider } from \"./providers/CaptchaProvider\";\nimport type { NavItem, AuthRootProps } from \"./types\";\nimport { AuthRoutes } from \"./AuthRoutes\";\nimport { useTr } from \"../shared/hooks/useTr\";\n\n/**\n * Root component for the Auth microfrontend.\n *\n * This is the main entry point that host applications import and render.\n * It sets up the necessary providers and renders the internal routing.\n * Automatically registers navigation items with the shell if registration functions are provided.\n *\n * @example\n * ```tsx\n * import { AuthRoot, type AuthRootProps } from '@burdenoff/microfe-auth';\n *\n * function App() {\n * const props: AuthRootProps = {\n * basePath: '/auth',\n * navigate: (path) => router.push(path),\n * apiGatewayUrl: 'http://localhost:4002',\n * authToken: 'token',\n * onAuthSuccess: (user) => shellLogin(user),\n * onLogout: () => shellLogout(),\n * };\n *\n * return <AuthRoot {...props} />;\n * }\n * ```\n */\nexport const AuthRoot: FC<AuthRootProps> = (props) => {\n const {\n registerNavItems,\n registerFooterItems,\n basePath = \"/\",\n // Admin routes (`/auth/users`, `/auth/users/:id`, `/auth/sso`,\n // `/auth/audit-log`) are opt-in: only the admin app shell should pass\n // `enableAdminRoutes={true}`. User-facing product hosts (vibecontrols,\n // workspaces, botlit, healthybowl, etc.) intentionally do not expose\n // these surfaces — gateway RBAC still gates the underlying\n // queries/mutations, but hiding the routes prevents accidental UI\n // discoverability. Must match the corresponding default in\n // `AuthRoutes.tsx`.\n enableAdminRoutes = false,\n bypassEnterprisePlanGate = false,\n } = props;\n const tr = useTr();\n const location = useLocation();\n\n // Normalize basePath (remove trailing slash)\n const normalizedBasePath = useMemo(\n () =>\n basePath && basePath !== \"/\"\n ? basePath.endsWith(\"/\")\n ? basePath.slice(0, -1)\n : basePath\n : \"\",\n [basePath],\n );\n\n // Helper to join paths correctly, avoiding double slashes\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith(\"/\") ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith(\"/\") ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with the shell\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: \"auth-security\",\n label: tr(\"auth.root.navSecurity\", \"Security Settings\"),\n path: joinPath(basePath, \"security\"),\n icon: <ShieldCheck size={20} />,\n order: 10,\n group: \"auth\",\n },\n {\n id: \"auth-sessions\",\n label: tr(\"auth.root.navSessions\", \"Active Sessions\"),\n path: joinPath(basePath, \"sessions\"),\n icon: <Laptop size={20} />,\n order: 20,\n group: \"auth\",\n },\n {\n id: \"auth-mfa\",\n label: tr(\"auth.root.navMfa\", \"Multi-Factor Auth\"),\n path: joinPath(basePath, \"mfa\"),\n icon: <Key size={20} />,\n order: 30,\n group: \"auth\",\n },\n // Hidden — moved to Developer Portal\n // {\n // id: \"auth-api-keys\",\n // label: \"API Keys\",\n // path: joinPath(basePath, \"api-keys\"),\n // icon: <Code size={20} />,\n // order: 40,\n // group: \"auth\",\n // },\n ...(enableAdminRoutes\n ? [\n {\n id: \"auth-sso\",\n label: tr(\"auth.root.navSso\", \"SSO Configuration\"),\n path: joinPath(basePath, \"sso\"),\n icon: <Building size={20} />,\n order: 50,\n group: \"auth\",\n },\n ]\n : []),\n ];\n\n // Register and get cleanup function\n const cleanup = registerNavItems(navItems);\n\n // Return cleanup function to unregister on unmount\n return cleanup;\n }, [registerNavItems, basePath, enableAdminRoutes, tr]);\n\n // Register footer items (example: auth status indicator)\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: \"auth-status\",\n label: tr(\"auth.root.footerReady\", \"Auth Ready\"),\n type: \"status\" as const,\n order: 10,\n section: \"left\" as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems, tr]);\n\n // Check if path matches - must be after all hooks\n const pathMatches = useMemo(() => {\n if (!normalizedBasePath) return true;\n return (\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + \"/\")\n );\n }, [normalizedBasePath, location.pathname]);\n\n // Early return after all hooks are called\n if (!pathMatches) {\n return null;\n }\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {tr(\n \"auth.root.loadError\",\n \"Something went wrong loading this module. Please refresh the page.\",\n )}\n </div>\n }\n >\n <FeatureFlagProvider\n workspaceId={null}\n gateway=\"global\"\n defaultEnabled={true}\n >\n <AuthProvider {...props}>\n <CaptchaProvider>\n <AuthRoutes\n basePath={normalizedBasePath}\n enableAdminRoutes={enableAdminRoutes}\n bypassEnterprisePlanGate={bypassEnterprisePlanGate}\n />\n </CaptchaProvider>\n </AuthProvider>\n </FeatureFlagProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;;;;;;AAqCA,IAAa,KAA+B,MAAU;CACpD,IAAM,EACJ,qBACA,wBACA,cAAW,KASX,uBAAoB,IACpB,8BAA2B,OACzB,GACE,IAAK,GAAO,EACZ,IAAW,GAAa,EAGxB,IAAqB,QAEvB,KAAY,MAAa,MACrB,EAAS,SAAS,IAAI,GACpB,EAAS,MAAM,GAAG,GAAG,GACrB,IACF,IACN,CAAC,EAAS,CACX,EAGK,KAAY,GAAc,OACZ,EAAK,SAAS,IAAI,GAAG,EAAK,MAAM,GAAG,GAAG,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,SAAQ;GACR,gBAAgB;aAEhB,kBAAC,GAAD;IAAc,GAAI;cAChB,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;KACE,UAAU;KACS;KACO;KAC1B,CAAA,EACc,CAAA;IACL,CAAA;GACK,CAAA;EACR,CAAA,GA7BT"}
|
package/dist/auth/AuthRoutes.js
CHANGED
|
@@ -97,6 +97,13 @@ function B({ basePath: e = "", enableAdminRoutes: c = !1, bypassEnterprisePlanGa
|
|
|
97
97
|
children: /* @__PURE__ */ h(y, {})
|
|
98
98
|
})
|
|
99
99
|
}),
|
|
100
|
+
/* @__PURE__ */ h(f, {
|
|
101
|
+
path: "signup",
|
|
102
|
+
element: /* @__PURE__ */ h(d, {
|
|
103
|
+
to: "register",
|
|
104
|
+
replace: !0
|
|
105
|
+
})
|
|
106
|
+
}),
|
|
100
107
|
/* @__PURE__ */ h(f, {
|
|
101
108
|
path: "reset-password",
|
|
102
109
|
element: /* @__PURE__ */ h(s, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthRoutes.js","names":[],"sources":["../../src/auth/AuthRoutes.tsx"],"sourcesContent":["import { lazy, Suspense, useEffect, useState } from \"react\";\nimport {\n useFeatureFlagDetails,\n FeatureGate,\n} from \"@burdenoff/fe-libs/shared/feature-flags\";\nimport { Navigate, Route, Routes } from \"react-router\";\nimport { useAuthStore } from \"./store/authStore\";\n\n// Eager imports - these are the most commonly accessed routes\nimport { LoginPage } from \"./pages/LoginPage\";\nimport { SessionBridgePage } from \"./pages/SessionBridgePage\";\nimport { SSORelayPage } from \"./pages/SSORelayPage\";\nimport { SSORelayCallbackPage } from \"./pages/SSORelayCallbackPage\";\nimport { SSODepositPage } from \"./pages/SSODepositPage\";\nimport { SSOClearPage } from \"./pages/SSOClearPage\";\n\n// Lazy-loaded pages - loaded on demand when their routes are accessed\nconst RegisterPage = lazy(() =>\n import(\"./pages/RegisterPage\").then((m) => ({ default: m.RegisterPage })),\n);\nconst PasswordResetPage = lazy(() =>\n import(\"./pages/PasswordResetPage\").then((m) => ({\n default: m.PasswordResetPage,\n })),\n);\nconst EmailVerifyPage = lazy(() =>\n import(\"./pages/EmailVerifyPage\").then((m) => ({\n default: m.EmailVerifyPage,\n })),\n);\nconst MfaVerifyPage = lazy(() =>\n import(\"./pages/MfaVerifyPage\").then((m) => ({ default: m.MfaVerifyPage })),\n);\nconst MagicLinkPage = lazy(() =>\n import(\"./pages/MagicLinkPage\").then((m) => ({ default: m.MagicLinkPage })),\n);\nconst ReactivatePage = lazy(() =>\n import(\"./pages/ReactivatePage\").then((m) => ({ default: m.ReactivatePage })),\n);\nconst SecurityPage = lazy(() =>\n import(\"./pages/SecurityPage\").then((m) => ({ default: m.SecurityPage })),\n);\nconst SessionsPage = lazy(() =>\n import(\"./pages/SessionsPage\").then((m) => ({ default: m.SessionsPage })),\n);\nconst MfaSetupPage = lazy(() =>\n import(\"./pages/MfaSetupPage\").then((m) => ({ default: m.MfaSetupPage })),\n);\nconst AuditLogPage = lazy(() =>\n import(\"./pages/AuditLogPage\").then((m) => ({ default: m.AuditLogPage })),\n);\nconst SsoConfigPage = lazy(() =>\n import(\"./pages/SsoConfigPage\").then((m) => ({ default: m.SsoConfigPage })),\n);\nconst SsoLoginPage = lazy(() =>\n import(\"./pages/SsoLoginPage\").then((m) => ({ default: m.SsoLoginPage })),\n);\nconst SsoCallbackPage = lazy(() =>\n import(\"./pages/SsoCallbackPage\").then((m) => ({\n default: m.SsoCallbackPage,\n })),\n);\nconst OAuthCallbackPage = lazy(() =>\n import(\"./pages/OAuthCallbackPage\").then((m) => ({\n default: m.OAuthCallbackPage,\n })),\n);\nconst UsersPage = lazy(() =>\n import(\"./pages/UsersPage\").then((m) => ({ default: m.UsersPage })),\n);\nconst UserDetailsPage = lazy(() =>\n import(\"./pages/UserDetailsPage\").then((m) => ({\n default: m.UserDetailsPage,\n })),\n);\nconst UserProfilePage = lazy(() =>\n import(\"./pages/UserProfilePage\").then((m) => ({\n default: m.UserProfilePage,\n })),\n);\n/**\n * Simple loading fallback for lazy-loaded pages\n */\nfunction PageLoader() {\n return (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <div className=\"size-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n}\n\nfunction decodeJwtExpiry(token: string): number | null {\n try {\n const payload = JSON.parse(\n atob(token.split(\".\")[1].replace(/-/g, \"+\").replace(/_/g, \"/\")),\n ) as { exp?: number };\n\n return typeof payload.exp === \"number\" ? payload.exp * 1000 : null;\n } catch {\n return null;\n }\n}\n\nfunction getStoredSessionSnapshot(): {\n hasValidSession: boolean;\n expiresAt: number | null;\n} {\n try {\n const activeProfileId = sessionStorage.getItem(\"bf-active-profile\");\n if (!activeProfileId) {\n return { hasValidSession: false, expiresAt: null };\n }\n\n const tokensRaw = localStorage.getItem(`bf-p-${activeProfileId}-tokens`);\n if (!tokensRaw) {\n return { hasValidSession: false, expiresAt: null };\n }\n\n const tokens = JSON.parse(tokensRaw) as {\n accessToken?: string;\n expiresAt?: number;\n };\n\n if (!tokens.accessToken) {\n return { hasValidSession: false, expiresAt: null };\n }\n\n const expiresAt =\n typeof tokens.expiresAt === \"number\"\n ? tokens.expiresAt\n : decodeJwtExpiry(tokens.accessToken);\n\n if (!expiresAt) {\n return { hasValidSession: false, expiresAt: null };\n }\n\n return {\n hasValidSession: expiresAt > Date.now(),\n expiresAt,\n };\n } catch {\n return { hasValidSession: false, expiresAt: null };\n }\n}\n\n/**\n * Protected route wrapper\n */\nfunction ProtectedRoute({ children }: { children: React.ReactNode }) {\n const isAuthenticated = useAuthStore((state) => state.isAuthenticated);\n const clearAuth = useAuthStore((state) => state.clearAuth);\n const [sessionCheckVersion, setSessionCheckVersion] = useState(0);\n const sessionSnapshot = getStoredSessionSnapshot();\n\n useEffect(() => {\n const handleSessionUpdate = () => {\n setSessionCheckVersion((value) => value + 1);\n };\n\n window.addEventListener(\"bf-profile-storage-change\", handleSessionUpdate);\n window.addEventListener(\"storage\", handleSessionUpdate);\n\n return () => {\n window.removeEventListener(\n \"bf-profile-storage-change\",\n handleSessionUpdate,\n );\n window.removeEventListener(\"storage\", handleSessionUpdate);\n };\n }, []);\n\n useEffect(() => {\n if (!sessionSnapshot.expiresAt) return;\n\n const timeoutMs = Math.max(sessionSnapshot.expiresAt - Date.now(), 0) + 50;\n const timer = window.setTimeout(() => {\n setSessionCheckVersion((value) => value + 1);\n }, timeoutMs);\n\n return () => window.clearTimeout(timer);\n }, [sessionSnapshot.expiresAt, sessionCheckVersion]);\n\n useEffect(() => {\n if (isAuthenticated && !sessionSnapshot.hasValidSession) {\n clearAuth();\n }\n }, [clearAuth, isAuthenticated, sessionSnapshot.hasValidSession]);\n\n if (!sessionSnapshot.hasValidSession) {\n return <Navigate to=\"/auth/login\" replace />;\n }\n\n return <>{children}</>;\n}\n\n/**\n * Internal router for the Auth microfrontend.\n * This component handles routing within the microfrontend using React Router v7.\n *\n * When used within a parent route (e.g., <Route path=\"/auth/*\">), all paths are relative:\n * - login → Login page (accessible at /auth/login)\n * - register → Registration page (accessible at /auth/register)\n * - reset-password → Password reset page (accessible at /auth/reset-password)\n * - verify-email → Email verification page (accessible at /auth/verify-email)\n * - mfa-verify → MFA verification page (accessible at /auth/mfa-verify)\n * - magic-link → Magic link authentication page (accessible at /auth/magic-link)\n * - sso/login → SSO login page (accessible at /auth/sso/login)\n * - sso/callback → SSO callback handler (accessible at /auth/sso/callback)\n * - oauth/callback → OAuth callback handler (accessible at /auth/oauth/callback)\n * - security → Security settings (protected, accessible at /auth/security)\n * - sessions → Active sessions (protected, accessible at /auth/sessions)\n * - mfa → MFA setup (protected, accessible at /auth/mfa)\n * - users → Users management (protected, admin only, accessible at /auth/users)\n * - profile → User profile page (protected, accessible at /auth/profile)\n * - audit-log → Security audit log (protected, accessible at /auth/audit-log)\n * - sso → SSO configuration (protected, admin only, accessible at /auth/sso)\n */\nexport function AuthRoutes({\n basePath: _basePath = \"\",\n // Admin routes (`/auth/users`, `/auth/users/:id`, `/auth/sso`,\n // `/auth/audit-log`) are opt-in: only the admin app shell should pass\n // `enableAdminRoutes={true}`. User-facing product hosts (vibecontrols,\n // workspaces, botlit, healthybowl, etc.) intentionally do not expose\n // these surfaces — the gateway's RBAC directives still gate the\n // underlying queries/mutations, but hiding the routes prevents\n // accidental UI discoverability and reduces the attack surface for\n // misconfigured permissions.\n enableAdminRoutes = false,\n bypassEnterprisePlanGate = false,\n}: {\n basePath?: string;\n enableAdminRoutes?: boolean;\n bypassEnterprisePlanGate?: boolean;\n}) {\n // Note: basePath is kept for backwards compatibility but not used in route paths\n // since React Router v7 uses relative paths when nested inside a parent <Route>\n const auditLogFlag = useFeatureFlagDetails(\"auth.audit-log\");\n const showAuditLog = auditLogFlag?.value === true;\n return (\n <Routes>\n {/* Public routes (no auth required) */}\n {/* LoginPage is eager-loaded as it's the most common entry point */}\n <Route path=\"login\" element={<LoginPage />} />\n <Route\n path=\"register\"\n element={\n <Suspense fallback={<PageLoader />}>\n <RegisterPage />\n </Suspense>\n }\n />\n <Route\n path=\"reset-password\"\n element={\n <Suspense fallback={<PageLoader />}>\n <PasswordResetPage />\n </Suspense>\n }\n />\n <Route\n path=\"verify-email\"\n element={\n <Suspense fallback={<PageLoader />}>\n <EmailVerifyPage />\n </Suspense>\n }\n />\n <Route\n path=\"mfa-verify\"\n element={\n <Suspense fallback={<PageLoader />}>\n <MfaVerifyPage />\n </Suspense>\n }\n />\n <Route\n path=\"magic-link\"\n element={\n <Suspense fallback={<PageLoader />}>\n <MagicLinkPage />\n </Suspense>\n }\n />\n\n {/* SSO routes (public) */}\n <Route\n path=\"sso/login\"\n element={\n <Suspense fallback={<PageLoader />}>\n <SsoLoginPage />\n </Suspense>\n }\n />\n <Route\n path=\"sso/callback\"\n element={\n <Suspense fallback={<PageLoader />}>\n <SsoCallbackPage />\n </Suspense>\n }\n />\n\n {/* OAuth callback route (public) */}\n <Route\n path=\"oauth/callback\"\n element={\n <Suspense fallback={<PageLoader />}>\n <OAuthCallbackPage />\n </Suspense>\n }\n />\n\n {/* Account reactivation (public) */}\n <Route\n path=\"reactivate\"\n element={\n <Suspense fallback={<PageLoader />}>\n <ReactivatePage />\n </Suspense>\n }\n />\n\n {/* Session bridge (public - embedded as hidden iframe by other app shells) */}\n <Route path=\"session-bridge\" element={<SessionBridgePage />} />\n\n {/* Cross-domain SSO relay (reads local tokens, redirects with them to target) */}\n <Route path=\"sso-relay\" element={<SSORelayPage />} />\n\n {/* Cross-domain SSO callback (receives tokens from relay, stores locally) */}\n <Route path=\"sso-callback\" element={<SSORelayCallbackPage />} />\n\n {/* Cross-domain SSO deposit (bridge host receives tokens on top-level\n redirect right after login on a product origin, writes first-party\n localStorage on the bridge origin so other products can discover\n the session). */}\n <Route path=\"sso-deposit\" element={<SSODepositPage />} />\n\n {/* Cross-domain SLO clear (bridge host clears its central session on\n top-level redirect from a product origin's logout). */}\n <Route path=\"sso-clear\" element={<SSOClearPage />} />\n\n {/* Protected routes (auth required) */}\n <Route\n path=\"security\"\n element={\n <ProtectedRoute>\n <FeatureGate flag=\"auth.security\" defaultValue={true}>\n <Suspense fallback={<PageLoader />}>\n <SecurityPage enableAdminRoutes={enableAdminRoutes} />\n </Suspense>\n </FeatureGate>\n </ProtectedRoute>\n }\n />\n <Route\n path=\"sessions\"\n element={\n <ProtectedRoute>\n <FeatureGate flag=\"auth.sessions\" defaultValue={true}>\n <Suspense fallback={<PageLoader />}>\n <SessionsPage />\n </Suspense>\n </FeatureGate>\n </ProtectedRoute>\n }\n />\n <Route\n path=\"mfa\"\n element={\n <ProtectedRoute>\n <FeatureGate flag=\"auth.mfa\" defaultValue={true}>\n <Suspense fallback={<PageLoader />}>\n <MfaSetupPage />\n </Suspense>\n </FeatureGate>\n </ProtectedRoute>\n }\n />\n {enableAdminRoutes && showAuditLog && (\n <Route\n path=\"audit-log\"\n element={\n <ProtectedRoute>\n <FeatureGate flag=\"auth.audit-log\" defaultValue={false}>\n <Suspense fallback={<PageLoader />}>\n <AuditLogPage />\n </Suspense>\n </FeatureGate>\n </ProtectedRoute>\n }\n />\n )}\n {!enableAdminRoutes && (\n <Route\n path=\"audit-log\"\n element={<Navigate to=\"/auth/login\" replace />}\n />\n )}\n <Route\n path=\"sso\"\n element={\n enableAdminRoutes ? (\n <ProtectedRoute>\n <FeatureGate flag=\"auth.sso\" defaultValue={true}>\n <Suspense fallback={<PageLoader />}>\n <SsoConfigPage\n bypassEnterprisePlanGate={bypassEnterprisePlanGate}\n />\n </Suspense>\n </FeatureGate>\n </ProtectedRoute>\n ) : (\n <Navigate to=\"/auth/login\" replace />\n )\n }\n />\n <Route\n path=\"users\"\n element={\n enableAdminRoutes ? (\n <ProtectedRoute>\n <FeatureGate flag=\"auth.users\" defaultValue={true}>\n <Suspense fallback={<PageLoader />}>\n <UsersPage />\n </Suspense>\n </FeatureGate>\n </ProtectedRoute>\n ) : (\n <Navigate to=\"/auth/login\" replace />\n )\n }\n />\n <Route\n path=\"users/:id\"\n element={\n enableAdminRoutes ? (\n <ProtectedRoute>\n <FeatureGate flag=\"auth.users\" defaultValue={true}>\n <Suspense fallback={<PageLoader />}>\n <UserDetailsPage />\n </Suspense>\n </FeatureGate>\n </ProtectedRoute>\n ) : (\n <Navigate to=\"/auth/login\" replace />\n )\n }\n />\n <Route\n path=\"profile\"\n element={\n <ProtectedRoute>\n <FeatureGate flag=\"auth.profile\" defaultValue={true}>\n <Suspense fallback={<PageLoader />}>\n <UserProfilePage />\n </Suspense>\n </FeatureGate>\n </ProtectedRoute>\n }\n />\n\n {/* Default redirect - when visiting /auth or /auth/ with no subpath */}\n <Route index element={<Navigate to=\"login\" replace />} />\n </Routes>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,IAAM,IAAe,QACnB,OAAO,2BAAwB,MAAM,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAC1E,EACK,IAAoB,QACxB,OAAO,gCAA6B,MAAM,OAAO,EAC/C,SAAS,EAAE,mBACZ,EAAE,CACJ,EACK,IAAkB,QACtB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th/AuthRoutes.tsx"],"sourcesContent":["import { lazy, Suspense, useEffect, useState } from \"react\";\nimport {\n useFeatureFlagDetails,\n FeatureGate,\n} from \"@burdenoff/fe-libs/shared/feature-flags\";\nimport { Navigate, Route, Routes } from \"react-router\";\nimport { useAuthStore } from \"./store/authStore\";\n\n// Eager imports - these are the most commonly accessed routes\nimport { LoginPage } from \"./pages/LoginPage\";\nimport { SessionBridgePage } from \"./pages/SessionBridgePage\";\nimport { SSORelayPage } from \"./pages/SSORelayPage\";\nimport { SSORelayCallbackPage } from \"./pages/SSORelayCallbackPage\";\nimport { SSODepositPage } from \"./pages/SSODepositPage\";\nimport { SSOClearPage } from \"./pages/SSOClearPage\";\n\n// Lazy-loaded pages - loaded on demand when their routes are accessed\nconst RegisterPage = lazy(() =>\n import(\"./pages/RegisterPage\").then((m) => ({ default: m.RegisterPage })),\n);\nconst PasswordResetPage = lazy(() =>\n import(\"./pages/PasswordResetPage\").then((m) => ({\n default: m.PasswordResetPage,\n })),\n);\nconst EmailVerifyPage = lazy(() =>\n import(\"./pages/EmailVerifyPage\").then((m) => ({\n default: m.EmailVerifyPage,\n })),\n);\nconst MfaVerifyPage = lazy(() =>\n import(\"./pages/MfaVerifyPage\").then((m) => ({ default: m.MfaVerifyPage })),\n);\nconst MagicLinkPage = lazy(() =>\n import(\"./pages/MagicLinkPage\").then((m) => ({ default: m.MagicLinkPage })),\n);\nconst ReactivatePage = lazy(() =>\n import(\"./pages/ReactivatePage\").then((m) => ({ default: m.ReactivatePage })),\n);\nconst SecurityPage = lazy(() =>\n import(\"./pages/SecurityPage\").then((m) => ({ default: m.SecurityPage })),\n);\nconst SessionsPage = lazy(() =>\n import(\"./pages/SessionsPage\").then((m) => ({ default: m.SessionsPage })),\n);\nconst MfaSetupPage = lazy(() =>\n import(\"./pages/MfaSetupPage\").then((m) => ({ default: m.MfaSetupPage })),\n);\nconst AuditLogPage = lazy(() =>\n import(\"./pages/AuditLogPage\").then((m) => ({ default: m.AuditLogPage })),\n);\nconst SsoConfigPage = lazy(() =>\n import(\"./pages/SsoConfigPage\").then((m) => ({ default: m.SsoConfigPage })),\n);\nconst SsoLoginPage = lazy(() =>\n import(\"./pages/SsoLoginPage\").then((m) => ({ default: m.SsoLoginPage })),\n);\nconst SsoCallbackPage = lazy(() =>\n import(\"./pages/SsoCallbackPage\").then((m) => ({\n default: m.SsoCallbackPage,\n })),\n);\nconst OAuthCallbackPage = lazy(() =>\n import(\"./pages/OAuthCallbackPage\").then((m) => ({\n default: m.OAuthCallbackPage,\n })),\n);\nconst UsersPage = lazy(() =>\n import(\"./pages/UsersPage\").then((m) => ({ default: m.UsersPage })),\n);\nconst UserDetailsPage = lazy(() =>\n import(\"./pages/UserDetailsPage\").then((m) => ({\n default: m.UserDetailsPage,\n })),\n);\nconst UserProfilePage = lazy(() =>\n import(\"./pages/UserProfilePage\").then((m) => ({\n default: m.UserProfilePage,\n })),\n);\n/**\n * Simple loading fallback for lazy-loaded pages\n */\nfunction PageLoader() {\n return (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <div className=\"size-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n}\n\nfunction decodeJwtExpiry(token: string): number | null {\n try {\n const payload = JSON.parse(\n atob(token.split(\".\")[1].replace(/-/g, \"+\").replace(/_/g, \"/\")),\n ) as { exp?: number };\n\n return typeof payload.exp === \"number\" ? payload.exp * 1000 : null;\n } catch {\n return null;\n }\n}\n\nfunction getStoredSessionSnapshot(): {\n hasValidSession: boolean;\n expiresAt: number | null;\n} {\n try {\n const activeProfileId = sessionStorage.getItem(\"bf-active-profile\");\n if (!activeProfileId) {\n return { hasValidSession: false, expiresAt: null };\n }\n\n const tokensRaw = localStorage.getItem(`bf-p-${activeProfileId}-tokens`);\n if (!tokensRaw) {\n return { hasValidSession: false, expiresAt: null };\n }\n\n const tokens = JSON.parse(tokensRaw) as {\n accessToken?: string;\n expiresAt?: number;\n };\n\n if (!tokens.accessToken) {\n return { hasValidSession: false, expiresAt: null };\n }\n\n const expiresAt =\n typeof tokens.expiresAt === \"number\"\n ? tokens.expiresAt\n : decodeJwtExpiry(tokens.accessToken);\n\n if (!expiresAt) {\n return { hasValidSession: false, expiresAt: null };\n }\n\n return {\n hasValidSession: expiresAt > Date.now(),\n expiresAt,\n };\n } catch {\n return { hasValidSession: false, expiresAt: null };\n }\n}\n\n/**\n * Protected route wrapper\n */\nfunction ProtectedRoute({ children }: { children: React.ReactNode }) {\n const isAuthenticated = useAuthStore((state) => state.isAuthenticated);\n const clearAuth = useAuthStore((state) => state.clearAuth);\n const [sessionCheckVersion, setSessionCheckVersion] = useState(0);\n const sessionSnapshot = getStoredSessionSnapshot();\n\n useEffect(() => {\n const handleSessionUpdate = () => {\n setSessionCheckVersion((value) => value + 1);\n };\n\n window.addEventListener(\"bf-profile-storage-change\", handleSessionUpdate);\n window.addEventListener(\"storage\", handleSessionUpdate);\n\n return () => {\n window.removeEventListener(\n \"bf-profile-storage-change\",\n handleSessionUpdate,\n );\n window.removeEventListener(\"storage\", handleSessionUpdate);\n };\n }, []);\n\n useEffect(() => {\n if (!sessionSnapshot.expiresAt) return;\n\n const timeoutMs = Math.max(sessionSnapshot.expiresAt - Date.now(), 0) + 50;\n const timer = window.setTimeout(() => {\n setSessionCheckVersion((value) => value + 1);\n }, timeoutMs);\n\n return () => window.clearTimeout(timer);\n }, [sessionSnapshot.expiresAt, sessionCheckVersion]);\n\n useEffect(() => {\n if (isAuthenticated && !sessionSnapshot.hasValidSession) {\n clearAuth();\n }\n }, [clearAuth, isAuthenticated, sessionSnapshot.hasValidSession]);\n\n if (!sessionSnapshot.hasValidSession) {\n return <Navigate to=\"/auth/login\" replace />;\n }\n\n return <>{children}</>;\n}\n\n/**\n * Internal router for the Auth microfrontend.\n * This component handles routing within the microfrontend using React Router v7.\n *\n * When used within a parent route (e.g., <Route path=\"/auth/*\">), all paths are relative:\n * - login → Login page (accessible at /auth/login)\n * - register → Registration page (accessible at /auth/register)\n * - reset-password → Password reset page (accessible at /auth/reset-password)\n * - verify-email → Email verification page (accessible at /auth/verify-email)\n * - mfa-verify → MFA verification page (accessible at /auth/mfa-verify)\n * - magic-link → Magic link authentication page (accessible at /auth/magic-link)\n * - sso/login → SSO login page (accessible at /auth/sso/login)\n * - sso/callback → SSO callback handler (accessible at /auth/sso/callback)\n * - oauth/callback → OAuth callback handler (accessible at /auth/oauth/callback)\n * - security → Security settings (protected, accessible at /auth/security)\n * - sessions → Active sessions (protected, accessible at /auth/sessions)\n * - mfa → MFA setup (protected, accessible at /auth/mfa)\n * - users → Users management (protected, admin only, accessible at /auth/users)\n * - profile → User profile page (protected, accessible at /auth/profile)\n * - audit-log → Security audit log (protected, accessible at /auth/audit-log)\n * - sso → SSO configuration (protected, admin only, accessible at /auth/sso)\n */\nexport function AuthRoutes({\n basePath: _basePath = \"\",\n // Admin routes (`/auth/users`, `/auth/users/:id`, `/auth/sso`,\n // `/auth/audit-log`) are opt-in: only the admin app shell should pass\n // `enableAdminRoutes={true}`. User-facing product hosts (vibecontrols,\n // workspaces, botlit, healthybowl, etc.) intentionally do not expose\n // these surfaces — the gateway's RBAC directives still gate the\n // underlying queries/mutations, but hiding the routes prevents\n // accidental UI discoverability and reduces the attack surface for\n // misconfigured permissions.\n enableAdminRoutes = false,\n bypassEnterprisePlanGate = false,\n}: {\n basePath?: string;\n enableAdminRoutes?: boolean;\n bypassEnterprisePlanGate?: boolean;\n}) {\n // Note: basePath is kept for backwards compatibility but not used in route paths\n // since React Router v7 uses relative paths when nested inside a parent <Route>\n const auditLogFlag = useFeatureFlagDetails(\"auth.audit-log\");\n const showAuditLog = auditLogFlag?.value === true;\n return (\n <Routes>\n {/* Public routes (no auth required) */}\n {/* LoginPage is eager-loaded as it's the most common entry point */}\n <Route path=\"login\" element={<LoginPage />} />\n <Route\n path=\"register\"\n element={\n <Suspense fallback={<PageLoader />}>\n <RegisterPage />\n </Suspense>\n }\n />\n {/* \"signup\" is the URL most people guess (it's the term this app's own\n copy uses — \"Create your account\" / sign up), but the route has\n always been \"register\" with nothing to catch the alias — it silently\n rendered a blank page. Redirect rather than rename register itself,\n since register is the established/linked path. */}\n <Route path=\"signup\" element={<Navigate to=\"register\" replace />} />\n <Route\n path=\"reset-password\"\n element={\n <Suspense fallback={<PageLoader />}>\n <PasswordResetPage />\n </Suspense>\n }\n />\n <Route\n path=\"verify-email\"\n element={\n <Suspense fallback={<PageLoader />}>\n <EmailVerifyPage />\n </Suspense>\n }\n />\n <Route\n path=\"mfa-verify\"\n element={\n <Suspense fallback={<PageLoader />}>\n <MfaVerifyPage />\n </Suspense>\n }\n />\n <Route\n path=\"magic-link\"\n element={\n <Suspense fallback={<PageLoader />}>\n <MagicLinkPage />\n </Suspense>\n }\n />\n\n {/* SSO routes (public) */}\n <Route\n path=\"sso/login\"\n element={\n <Suspense fallback={<PageLoader />}>\n <SsoLoginPage />\n </Suspense>\n }\n />\n <Route\n path=\"sso/callback\"\n element={\n <Suspense fallback={<PageLoader />}>\n <SsoCallbackPage />\n </Suspense>\n }\n />\n\n {/* OAuth callback route (public) */}\n <Route\n path=\"oauth/callback\"\n element={\n <Suspense fallback={<PageLoader />}>\n <OAuthCallbackPage />\n </Suspense>\n }\n />\n\n {/* Account reactivation (public) */}\n <Route\n path=\"reactivate\"\n element={\n <Suspense fallback={<PageLoader />}>\n <ReactivatePage />\n </Suspense>\n }\n />\n\n {/* Session bridge (public - embedded as hidden iframe by other app shells) */}\n <Route path=\"session-bridge\" element={<SessionBridgePage />} />\n\n {/* Cross-domain SSO relay (reads local tokens, redirects with them to target) */}\n <Route path=\"sso-relay\" element={<SSORelayPage />} />\n\n {/* Cross-domain SSO callback (receives tokens from relay, stores locally) */}\n <Route path=\"sso-callback\" element={<SSORelayCallbackPage />} />\n\n {/* Cross-domain SSO deposit (bridge host receives tokens on top-level\n redirect right after login on a product origin, writes first-party\n localStorage on the bridge origin so other products can discover\n the session). */}\n <Route path=\"sso-deposit\" element={<SSODepositPage />} />\n\n {/* Cross-domain SLO clear (bridge host clears its central session on\n top-level redirect from a product origin's logout). */}\n <Route path=\"sso-clear\" element={<SSOClearPage />} />\n\n {/* Protected routes (auth required) */}\n <Route\n path=\"security\"\n element={\n <ProtectedRoute>\n <FeatureGate flag=\"auth.security\" defaultValue={true}>\n <Suspense fallback={<PageLoader />}>\n <SecurityPage enableAdminRoutes={enableAdminRoutes} />\n </Suspense>\n </FeatureGate>\n </ProtectedRoute>\n }\n />\n <Route\n path=\"sessions\"\n element={\n <ProtectedRoute>\n <FeatureGate flag=\"auth.sessions\" defaultValue={true}>\n <Suspense fallback={<PageLoader />}>\n <SessionsPage />\n </Suspense>\n </FeatureGate>\n </ProtectedRoute>\n }\n />\n <Route\n path=\"mfa\"\n element={\n <ProtectedRoute>\n <FeatureGate flag=\"auth.mfa\" defaultValue={true}>\n <Suspense fallback={<PageLoader />}>\n <MfaSetupPage />\n </Suspense>\n </FeatureGate>\n </ProtectedRoute>\n }\n />\n {enableAdminRoutes && showAuditLog && (\n <Route\n path=\"audit-log\"\n element={\n <ProtectedRoute>\n <FeatureGate flag=\"auth.audit-log\" defaultValue={false}>\n <Suspense fallback={<PageLoader />}>\n <AuditLogPage />\n </Suspense>\n </FeatureGate>\n </ProtectedRoute>\n }\n />\n )}\n {!enableAdminRoutes && (\n <Route\n path=\"audit-log\"\n element={<Navigate to=\"/auth/login\" replace />}\n />\n )}\n <Route\n path=\"sso\"\n element={\n enableAdminRoutes ? (\n <ProtectedRoute>\n <FeatureGate flag=\"auth.sso\" defaultValue={true}>\n <Suspense fallback={<PageLoader />}>\n <SsoConfigPage\n bypassEnterprisePlanGate={bypassEnterprisePlanGate}\n />\n </Suspense>\n </FeatureGate>\n </ProtectedRoute>\n ) : (\n <Navigate to=\"/auth/login\" replace />\n )\n }\n />\n <Route\n path=\"users\"\n element={\n enableAdminRoutes ? (\n <ProtectedRoute>\n <FeatureGate flag=\"auth.users\" defaultValue={true}>\n <Suspense fallback={<PageLoader />}>\n <UsersPage />\n </Suspense>\n </FeatureGate>\n </ProtectedRoute>\n ) : (\n <Navigate to=\"/auth/login\" replace />\n )\n }\n />\n <Route\n path=\"users/:id\"\n element={\n enableAdminRoutes ? (\n <ProtectedRoute>\n <FeatureGate flag=\"auth.users\" defaultValue={true}>\n <Suspense fallback={<PageLoader />}>\n <UserDetailsPage />\n </Suspense>\n </FeatureGate>\n </ProtectedRoute>\n ) : (\n <Navigate to=\"/auth/login\" replace />\n )\n }\n />\n <Route\n path=\"profile\"\n element={\n <ProtectedRoute>\n <FeatureGate flag=\"auth.profile\" defaultValue={true}>\n <Suspense fallback={<PageLoader />}>\n <UserProfilePage />\n </Suspense>\n </FeatureGate>\n </ProtectedRoute>\n }\n />\n\n {/* Default redirect - when visiting /auth or /auth/ with no subpath */}\n <Route index element={<Navigate to=\"login\" replace />} />\n </Routes>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,IAAM,IAAe,QACnB,OAAO,2BAAwB,MAAM,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAC1E,EACK,IAAoB,QACxB,OAAO,gCAA6B,MAAM,OAAO,EAC/C,SAAS,EAAE,mBACZ,EAAE,CACJ,EACK,IAAkB,QACtB,OAAO,8BAA2B,MAAM,OAAO,EAC7C,SAAS,EAAE,iBACZ,EAAE,CACJ,EACK,IAAgB,QACpB,OAAO,4BAAyB,MAAM,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAC5E,EACK,IAAgB,QACpB,OAAO,4BAAyB,MAAM,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAC5E,EACK,IAAiB,QACrB,OAAO,6BAA0B,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAC9E,EACK,IAAe,QACnB,OAAO,2BAAwB,MAAM,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAC1E,EACK,IAAe,QACnB,OAAO,2BAAwB,MAAM,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAC1E,EACK,IAAe,QACnB,OAAO,2BAA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,GAAD,EAAa,CAAA;KACJ,CAAA;IACC,CAAA,EACC,CAAA,GAEjB,kBAAC,GAAD;IAAU,IAAG;IAAc,SAAA;IAAU,CAAA;GAGzC,CAAA;EACF,kBAAC,GAAD;GACE,MAAK;GACL,SACE,IACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;IAAa,MAAK;IAAa,cAAc;cAC3C,kBAAC,GAAD;KAAU,UAAU,kBAAC,GAAD,EAAc,CAAA;eAChC,kBAAC,GAAD,EAAmB,CAAA;KACV,CAAA;IACC,CAAA,EACC,CAAA,GAEjB,kBAAC,GAAD;IAAU,IAAG;IAAc,SAAA;IAAU,CAAA;GAGzC,CAAA;EACF,kBAAC,GAAD;GACE,MAAK;GACL,SACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;IAAa,MAAK;IAAe,cAAc;cAC7C,kBAAC,GAAD;KAAU,UAAU,kBAAC,GAAD,EAAc,CAAA;eAChC,kBAAC,GAAD,EAAmB,CAAA;KACV,CAAA;IACC,CAAA,EACC,CAAA;GAEnB,CAAA;EAGF,kBAAC,GAAD;GAAO,OAAA;GAAM,SAAS,kBAAC,GAAD;IAAU,IAAG;IAAQ,SAAA;IAAU,CAAA;GAAI,CAAA;EAClD,EAAA,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { useTr as e } from "../../shared/hooks/useTr.js";
|
|
2
|
+
import { useState as t } from "react";
|
|
3
|
+
import { useAppShell as n, useI18n as r } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import { LanguageSwitcher as o } from "@burdenoff/fe-libs/chrome";
|
|
5
6
|
//#region src/auth/components/AuthLayout.tsx
|
|
6
|
-
var
|
|
7
|
+
var s = [
|
|
7
8
|
{
|
|
8
9
|
code: "en",
|
|
9
10
|
name: "English",
|
|
@@ -41,129 +42,126 @@ var o = [
|
|
|
41
42
|
flag: "🇸🇦"
|
|
42
43
|
}
|
|
43
44
|
];
|
|
44
|
-
function
|
|
45
|
-
let [n,
|
|
46
|
-
return n ? /* @__PURE__ */
|
|
45
|
+
function c({ brandInitial: e }) {
|
|
46
|
+
let [n, r] = t(!1);
|
|
47
|
+
return n ? /* @__PURE__ */ i("div", {
|
|
47
48
|
className: "auth-brand-badge flex size-10 items-center justify-center rounded-xl",
|
|
48
|
-
children: /* @__PURE__ */
|
|
49
|
+
children: /* @__PURE__ */ i("span", {
|
|
49
50
|
className: "text-lg font-bold leading-none text-white",
|
|
50
|
-
children:
|
|
51
|
+
children: e
|
|
51
52
|
})
|
|
52
|
-
}) : /* @__PURE__ */
|
|
53
|
+
}) : /* @__PURE__ */ i("img", {
|
|
53
54
|
src: "/icons/icon.svg",
|
|
54
55
|
alt: "",
|
|
55
56
|
"aria-hidden": "true",
|
|
56
57
|
className: "size-10 rounded-xl object-contain",
|
|
57
|
-
onError: () =>
|
|
58
|
+
onError: () => r(!0)
|
|
58
59
|
});
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
-
let
|
|
62
|
-
|
|
63
|
-
return n === e ? t : n;
|
|
64
|
-
};
|
|
65
|
-
return /* @__PURE__ */ i("div", {
|
|
61
|
+
function l({ children: t, title: l, subtitle: u, productName: d, tagline: f }) {
|
|
62
|
+
let p = e(), m = n(), h = d || m.productName || "Burdenoff", g = m.brandInitial || "B", _ = f || m.tagline || "Enterprise platform", { locale: v, setLocale: y } = r();
|
|
63
|
+
return /* @__PURE__ */ a("div", {
|
|
66
64
|
className: "min-h-screen flex relative",
|
|
67
|
-
children: [/* @__PURE__ */
|
|
65
|
+
children: [/* @__PURE__ */ a("div", {
|
|
68
66
|
className: "auth-brand-panel hidden overflow-hidden lg:flex lg:w-1/2 relative",
|
|
69
|
-
children: [/* @__PURE__ */
|
|
67
|
+
children: [/* @__PURE__ */ a("div", {
|
|
70
68
|
className: "absolute inset-0 overflow-hidden",
|
|
71
69
|
children: [
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ i("div", { className: "absolute -top-40 -left-40 size-80 rounded-full bg-accent-blue/20 blur-3xl" }),
|
|
71
|
+
/* @__PURE__ */ i("div", { className: "absolute top-1/2 -right-20 size-96 rounded-full bg-accent-indigo/20 blur-3xl" }),
|
|
72
|
+
/* @__PURE__ */ i("div", { className: "absolute -bottom-40 left-1/4 size-72 rounded-full bg-accent-purple/20 blur-3xl" }),
|
|
73
|
+
/* @__PURE__ */ i("div", {
|
|
76
74
|
className: "absolute inset-0 opacity-5",
|
|
77
75
|
style: { backgroundImage: "url(\"data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E\")" }
|
|
78
76
|
})
|
|
79
77
|
]
|
|
80
|
-
}), /* @__PURE__ */
|
|
78
|
+
}), /* @__PURE__ */ a("div", {
|
|
81
79
|
className: "relative z-10 flex flex-col justify-between p-12 w-full",
|
|
82
80
|
children: [
|
|
83
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ a("div", {
|
|
84
82
|
className: "flex items-center gap-3",
|
|
85
|
-
children: [/* @__PURE__ */
|
|
83
|
+
children: [/* @__PURE__ */ i(c, { brandInitial: g }), /* @__PURE__ */ i("span", {
|
|
86
84
|
className: "text-xl font-bold text-[var(--color-text-primary)]",
|
|
87
|
-
children:
|
|
85
|
+
children: h
|
|
88
86
|
})]
|
|
89
87
|
}),
|
|
90
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ a("div", {
|
|
91
89
|
className: "max-w-md",
|
|
92
90
|
children: [
|
|
93
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ i("h1", {
|
|
94
92
|
className: "mb-4 text-4xl font-bold leading-tight text-[var(--color-text-primary)]",
|
|
95
|
-
children:
|
|
93
|
+
children: _
|
|
96
94
|
}),
|
|
97
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ i("p", {
|
|
98
96
|
className: "auth-brand-copy text-lg leading-relaxed",
|
|
99
|
-
children:
|
|
97
|
+
children: p("auth.layout.taglineDescription", "Unify your teams, projects, and workflows in one intelligent workspace. Built for scale with enterprise-grade security, real-time collaboration, and seamless integrations across your entire organization.")
|
|
100
98
|
}),
|
|
101
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ i("div", {
|
|
102
100
|
className: "mt-10 space-y-4",
|
|
103
101
|
children: [
|
|
104
102
|
{
|
|
105
103
|
icon: "workspace",
|
|
106
|
-
text:
|
|
104
|
+
text: p("auth.layout.featureWorkspace", "Modular workspace architecture")
|
|
107
105
|
},
|
|
108
106
|
{
|
|
109
107
|
icon: "realtime",
|
|
110
|
-
text:
|
|
108
|
+
text: p("auth.layout.featureRealtime", "Real-time collaboration & sync")
|
|
111
109
|
},
|
|
112
110
|
{
|
|
113
111
|
icon: "security",
|
|
114
|
-
text:
|
|
112
|
+
text: p("auth.layout.featureSecurity", "Enterprise-grade security & SSO")
|
|
115
113
|
},
|
|
116
114
|
{
|
|
117
115
|
icon: "scale",
|
|
118
|
-
text:
|
|
116
|
+
text: p("auth.layout.featureScale", "Unlimited scalability & performance")
|
|
119
117
|
}
|
|
120
|
-
].map((e) => /* @__PURE__ */
|
|
118
|
+
].map((e) => /* @__PURE__ */ a("div", {
|
|
121
119
|
className: "flex items-center gap-3",
|
|
122
|
-
children: [/* @__PURE__ */
|
|
120
|
+
children: [/* @__PURE__ */ a("div", {
|
|
123
121
|
className: "auth-highlight-chip flex size-8 items-center justify-center rounded-lg",
|
|
124
122
|
children: [
|
|
125
|
-
e.icon === "workspace" && /* @__PURE__ */
|
|
123
|
+
e.icon === "workspace" && /* @__PURE__ */ i("svg", {
|
|
126
124
|
className: "size-4 text-accent-blue",
|
|
127
125
|
fill: "none",
|
|
128
126
|
viewBox: "0 0 24 24",
|
|
129
127
|
stroke: "currentColor",
|
|
130
|
-
children: /* @__PURE__ */
|
|
128
|
+
children: /* @__PURE__ */ i("path", {
|
|
131
129
|
strokeLinecap: "round",
|
|
132
130
|
strokeLinejoin: "round",
|
|
133
131
|
strokeWidth: 2,
|
|
134
132
|
d: "M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"
|
|
135
133
|
})
|
|
136
134
|
}),
|
|
137
|
-
e.icon === "realtime" && /* @__PURE__ */
|
|
135
|
+
e.icon === "realtime" && /* @__PURE__ */ i("svg", {
|
|
138
136
|
className: "size-4 text-accent-blue",
|
|
139
137
|
fill: "none",
|
|
140
138
|
viewBox: "0 0 24 24",
|
|
141
139
|
stroke: "currentColor",
|
|
142
|
-
children: /* @__PURE__ */
|
|
140
|
+
children: /* @__PURE__ */ i("path", {
|
|
143
141
|
strokeLinecap: "round",
|
|
144
142
|
strokeLinejoin: "round",
|
|
145
143
|
strokeWidth: 2,
|
|
146
144
|
d: "M17 8h2a2 2 0 012 2v6a2 2 0 01-2 2h-2v4l-4-4H9a1.994 1.994 0 01-1.414-.586m0 0L11 14h4a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2v4l.586-.586z"
|
|
147
145
|
})
|
|
148
146
|
}),
|
|
149
|
-
e.icon === "security" && /* @__PURE__ */
|
|
147
|
+
e.icon === "security" && /* @__PURE__ */ i("svg", {
|
|
150
148
|
className: "size-4 text-accent-blue",
|
|
151
149
|
fill: "none",
|
|
152
150
|
viewBox: "0 0 24 24",
|
|
153
151
|
stroke: "currentColor",
|
|
154
|
-
children: /* @__PURE__ */
|
|
152
|
+
children: /* @__PURE__ */ i("path", {
|
|
155
153
|
strokeLinecap: "round",
|
|
156
154
|
strokeLinejoin: "round",
|
|
157
155
|
strokeWidth: 2,
|
|
158
156
|
d: "M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"
|
|
159
157
|
})
|
|
160
158
|
}),
|
|
161
|
-
e.icon === "scale" && /* @__PURE__ */
|
|
159
|
+
e.icon === "scale" && /* @__PURE__ */ i("svg", {
|
|
162
160
|
className: "size-4 text-accent-blue",
|
|
163
161
|
fill: "none",
|
|
164
162
|
viewBox: "0 0 24 24",
|
|
165
163
|
stroke: "currentColor",
|
|
166
|
-
children: /* @__PURE__ */
|
|
164
|
+
children: /* @__PURE__ */ i("path", {
|
|
167
165
|
strokeLinecap: "round",
|
|
168
166
|
strokeLinejoin: "round",
|
|
169
167
|
strokeWidth: 2,
|
|
@@ -171,7 +169,7 @@ function c({ children: e, title: c, subtitle: l, productName: u, tagline: d }) {
|
|
|
171
169
|
})
|
|
172
170
|
})
|
|
173
171
|
]
|
|
174
|
-
}), /* @__PURE__ */
|
|
172
|
+
}), /* @__PURE__ */ i("span", {
|
|
175
173
|
className: "auth-brand-copy text-sm font-medium",
|
|
176
174
|
children: e.text
|
|
177
175
|
})]
|
|
@@ -179,7 +177,7 @@ function c({ children: e, title: c, subtitle: l, productName: u, tagline: d }) {
|
|
|
179
177
|
})
|
|
180
178
|
]
|
|
181
179
|
}),
|
|
182
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ a("div", {
|
|
183
181
|
className: "auth-brand-copy-muted text-sm",
|
|
184
182
|
children: [
|
|
185
183
|
"© ",
|
|
@@ -189,44 +187,44 @@ function c({ children: e, title: c, subtitle: l, productName: u, tagline: d }) {
|
|
|
189
187
|
})
|
|
190
188
|
]
|
|
191
189
|
})]
|
|
192
|
-
}), /* @__PURE__ */
|
|
190
|
+
}), /* @__PURE__ */ a("main", {
|
|
193
191
|
className: "auth-shell-gradient relative flex flex-1 items-center justify-center bg-[var(--color-bg-canvas)] p-6 sm:p-12",
|
|
194
|
-
children: [/* @__PURE__ */
|
|
192
|
+
children: [/* @__PURE__ */ i("div", {
|
|
195
193
|
className: "absolute top-4 right-4 sm:top-6 sm:right-6 z-10",
|
|
196
|
-
children: /* @__PURE__ */
|
|
197
|
-
languages:
|
|
198
|
-
currentLanguage:
|
|
194
|
+
children: /* @__PURE__ */ i(o, {
|
|
195
|
+
languages: s,
|
|
196
|
+
currentLanguage: v,
|
|
199
197
|
onLanguageChange: (e) => {
|
|
200
|
-
|
|
198
|
+
y(e.code);
|
|
201
199
|
}
|
|
202
200
|
})
|
|
203
|
-
}), /* @__PURE__ */
|
|
201
|
+
}), /* @__PURE__ */ a("div", {
|
|
204
202
|
className: "w-full max-w-md",
|
|
205
203
|
children: [
|
|
206
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ a("div", {
|
|
207
205
|
className: "lg:hidden flex items-center justify-center gap-3 mb-8",
|
|
208
|
-
children: [/* @__PURE__ */
|
|
206
|
+
children: [/* @__PURE__ */ i(c, { brandInitial: g }), /* @__PURE__ */ i("span", {
|
|
209
207
|
className: "text-xl font-bold text-[var(--color-text-primary)]",
|
|
210
|
-
children:
|
|
208
|
+
children: h
|
|
211
209
|
})]
|
|
212
210
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ a("div", {
|
|
214
212
|
className: "text-center lg:text-left mb-8",
|
|
215
|
-
children: [/* @__PURE__ */
|
|
213
|
+
children: [/* @__PURE__ */ i("h2", {
|
|
216
214
|
className: "text-2xl sm:text-3xl font-bold text-[var(--color-text-primary)] mb-2",
|
|
217
|
-
children: c
|
|
218
|
-
}), /* @__PURE__ */ r("p", {
|
|
219
|
-
className: "text-[var(--color-text-secondary)]",
|
|
220
215
|
children: l
|
|
216
|
+
}), /* @__PURE__ */ i("p", {
|
|
217
|
+
className: "text-[var(--color-text-secondary)]",
|
|
218
|
+
children: u
|
|
221
219
|
})]
|
|
222
220
|
}),
|
|
223
|
-
|
|
221
|
+
t
|
|
224
222
|
]
|
|
225
223
|
})]
|
|
226
224
|
})]
|
|
227
225
|
});
|
|
228
226
|
}
|
|
229
227
|
//#endregion
|
|
230
|
-
export {
|
|
228
|
+
export { l as AuthLayout };
|
|
231
229
|
|
|
232
230
|
//# sourceMappingURL=AuthLayout.js.map
|