@burdenoff/microfe-auth 2026.624.2 → 2026.625.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/hooks/index.js +1 -0
- package/dist/auth/hooks/useActiveContextBootstrapMirror.js +27 -0
- package/dist/auth/hooks/useActiveContextBootstrapMirror.js.map +1 -0
- package/dist/auth/index.js +1 -0
- package/dist/auth/pages/AuditLogPage.js +73 -72
- package/dist/auth/pages/AuditLogPage.js.map +1 -1
- package/dist/auth/pages/EmailVerifyPage.js +58 -53
- package/dist/auth/pages/EmailVerifyPage.js.map +1 -1
- package/dist/auth/pages/LoginPage.js +222 -214
- package/dist/auth/pages/LoginPage.js.map +1 -1
- package/dist/auth/pages/MagicLinkPage.js +75 -68
- package/dist/auth/pages/MagicLinkPage.js.map +1 -1
- package/dist/auth/pages/MfaSetupPage.js +176 -138
- package/dist/auth/pages/MfaSetupPage.js.map +1 -1
- package/dist/auth/pages/MfaVerifyPage.js +60 -52
- package/dist/auth/pages/MfaVerifyPage.js.map +1 -1
- package/dist/auth/pages/PasswordResetPage.js +277 -262
- package/dist/auth/pages/PasswordResetPage.js.map +1 -1
- package/dist/auth/pages/ReactivatePage.js +54 -46
- package/dist/auth/pages/ReactivatePage.js.map +1 -1
- package/dist/auth/pages/RegisterPage.js +223 -213
- package/dist/auth/pages/RegisterPage.js.map +1 -1
- package/dist/auth/pages/SecurityPage.js +298 -267
- package/dist/auth/pages/SecurityPage.js.map +1 -1
- package/dist/auth/pages/SessionsPage.js +169 -160
- package/dist/auth/pages/SessionsPage.js.map +1 -1
- package/dist/auth/pages/SsoCallbackPage.js +53 -50
- package/dist/auth/pages/SsoCallbackPage.js.map +1 -1
- package/dist/auth/pages/SsoConfigPage.js +466 -444
- package/dist/auth/pages/SsoConfigPage.js.map +1 -1
- package/dist/auth/pages/SsoLoginPage.js +67 -59
- package/dist/auth/pages/SsoLoginPage.js.map +1 -1
- package/dist/auth/pages/UserDetailsPage.js +154 -144
- package/dist/auth/pages/UserDetailsPage.js.map +1 -1
- package/dist/auth/pages/UserProfilePage.js +211 -170
- package/dist/auth/pages/UserProfilePage.js.map +1 -1
- package/dist/auth/pages/UsersPage.js +572 -576
- package/dist/auth/pages/UsersPage.js.map +1 -1
- package/dist/index.js +7 -6
- package/dist/microfe-auth.css +1 -1
- package/package.json +2 -2
|
@@ -1,447 +1,455 @@
|
|
|
1
1
|
import { useAuthStore as e } from "../store/authStore.js";
|
|
2
2
|
import { useAuthOperations as t } from "../hooks/useAuthOperations.js";
|
|
3
3
|
import { useAccountOperations as n } from "../hooks/useAccountOperations.js";
|
|
4
|
-
import { formatDate as
|
|
5
|
-
import { ConfirmActionDialog as
|
|
6
|
-
import { nativeImpact as
|
|
7
|
-
import { useEffect as
|
|
8
|
-
import { useNavigate as
|
|
9
|
-
import { useI18n as
|
|
10
|
-
import { jsx as
|
|
4
|
+
import { formatDate as ee } from "../utils/formatters.js";
|
|
5
|
+
import { ConfirmActionDialog as te } from "../components/ConfirmActionDialog.js";
|
|
6
|
+
import { nativeImpact as ne, nativeNotify as r } from "../../utils/nativeBridge.js";
|
|
7
|
+
import { useEffect as i, useId as a, useRef as o, useState as s } from "react";
|
|
8
|
+
import { useNavigate as re } from "react-router-dom";
|
|
9
|
+
import { useI18n as ie } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
10
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
11
|
+
import { Button as u } from "@burdenoff/fe-libs/button";
|
|
12
|
+
import { EmphasisPanel as ae, NextSteps as oe, PagePurpose as d } from "@burdenoff/fe-libs/ui";
|
|
11
13
|
//#region src/auth/pages/SecurityPage.tsx
|
|
12
|
-
var f = ({ className: e }) => /* @__PURE__ */
|
|
14
|
+
var f = ({ className: e }) => /* @__PURE__ */ c("svg", {
|
|
13
15
|
className: e,
|
|
14
16
|
fill: "none",
|
|
15
17
|
viewBox: "0 0 24 24",
|
|
16
18
|
stroke: "currentColor",
|
|
17
19
|
"aria-hidden": "true",
|
|
18
|
-
children: /* @__PURE__ */
|
|
20
|
+
children: /* @__PURE__ */ c("path", {
|
|
19
21
|
strokeLinecap: "round",
|
|
20
22
|
strokeLinejoin: "round",
|
|
21
23
|
strokeWidth: 1.5,
|
|
22
24
|
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"
|
|
23
25
|
})
|
|
24
|
-
}),
|
|
26
|
+
}), p = ({ className: e }) => /* @__PURE__ */ c("svg", {
|
|
25
27
|
className: e,
|
|
26
28
|
fill: "none",
|
|
27
29
|
viewBox: "0 0 24 24",
|
|
28
30
|
stroke: "currentColor",
|
|
29
31
|
"aria-hidden": "true",
|
|
30
|
-
children: /* @__PURE__ */
|
|
32
|
+
children: /* @__PURE__ */ c("path", {
|
|
31
33
|
strokeLinecap: "round",
|
|
32
34
|
strokeLinejoin: "round",
|
|
33
35
|
strokeWidth: 1.5,
|
|
34
36
|
d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"
|
|
35
37
|
})
|
|
36
|
-
}),
|
|
38
|
+
}), m = ({ className: e }) => /* @__PURE__ */ c("svg", {
|
|
37
39
|
className: e,
|
|
38
40
|
fill: "none",
|
|
39
41
|
viewBox: "0 0 24 24",
|
|
40
42
|
stroke: "currentColor",
|
|
41
43
|
"aria-hidden": "true",
|
|
42
|
-
children: /* @__PURE__ */
|
|
44
|
+
children: /* @__PURE__ */ c("path", {
|
|
43
45
|
strokeLinecap: "round",
|
|
44
46
|
strokeLinejoin: "round",
|
|
45
47
|
strokeWidth: 1.5,
|
|
46
48
|
d: "M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"
|
|
47
49
|
})
|
|
48
|
-
}),
|
|
50
|
+
}), se = ({ className: e }) => /* @__PURE__ */ c("svg", {
|
|
49
51
|
className: e,
|
|
50
52
|
fill: "none",
|
|
51
53
|
viewBox: "0 0 24 24",
|
|
52
54
|
stroke: "currentColor",
|
|
53
55
|
"aria-hidden": "true",
|
|
54
|
-
children: /* @__PURE__ */
|
|
56
|
+
children: /* @__PURE__ */ c("path", {
|
|
55
57
|
strokeLinecap: "round",
|
|
56
58
|
strokeLinejoin: "round",
|
|
57
59
|
strokeWidth: 1.5,
|
|
58
60
|
d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"
|
|
59
61
|
})
|
|
60
|
-
}),
|
|
62
|
+
}), ce = ({ className: e }) => /* @__PURE__ */ c("svg", {
|
|
61
63
|
className: e,
|
|
62
64
|
fill: "none",
|
|
63
65
|
viewBox: "0 0 24 24",
|
|
64
66
|
stroke: "currentColor",
|
|
65
67
|
"aria-hidden": "true",
|
|
66
|
-
children: /* @__PURE__ */
|
|
68
|
+
children: /* @__PURE__ */ c("path", {
|
|
67
69
|
strokeLinecap: "round",
|
|
68
70
|
strokeLinejoin: "round",
|
|
69
71
|
strokeWidth: 1.5,
|
|
70
72
|
d: "M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"
|
|
71
73
|
})
|
|
72
|
-
}),
|
|
74
|
+
}), h = ({ className: e }) => /* @__PURE__ */ c("svg", {
|
|
73
75
|
className: e,
|
|
74
76
|
fill: "none",
|
|
75
77
|
viewBox: "0 0 24 24",
|
|
76
78
|
stroke: "currentColor",
|
|
77
79
|
"aria-hidden": "true",
|
|
78
|
-
children: /* @__PURE__ */
|
|
80
|
+
children: /* @__PURE__ */ c("path", {
|
|
79
81
|
strokeLinecap: "round",
|
|
80
82
|
strokeLinejoin: "round",
|
|
81
83
|
strokeWidth: 2,
|
|
82
84
|
d: "M9 5l7 7-7 7"
|
|
83
85
|
})
|
|
84
|
-
}),
|
|
86
|
+
}), g = ({ className: e }) => /* @__PURE__ */ c("svg", {
|
|
85
87
|
className: e,
|
|
86
88
|
fill: "currentColor",
|
|
87
89
|
viewBox: "0 0 20 20",
|
|
88
90
|
"aria-hidden": "true",
|
|
89
|
-
children: /* @__PURE__ */
|
|
91
|
+
children: /* @__PURE__ */ c("path", {
|
|
90
92
|
fillRule: "evenodd",
|
|
91
93
|
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
|
|
92
94
|
clipRule: "evenodd"
|
|
93
95
|
})
|
|
94
|
-
}),
|
|
96
|
+
}), _ = ({ className: e }) => /* @__PURE__ */ c("svg", {
|
|
95
97
|
className: e,
|
|
96
98
|
fill: "currentColor",
|
|
97
99
|
viewBox: "0 0 20 20",
|
|
98
100
|
"aria-hidden": "true",
|
|
99
|
-
children: /* @__PURE__ */
|
|
101
|
+
children: /* @__PURE__ */ c("path", {
|
|
100
102
|
fillRule: "evenodd",
|
|
101
103
|
d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",
|
|
102
104
|
clipRule: "evenodd"
|
|
103
105
|
})
|
|
104
|
-
}),
|
|
106
|
+
}), v = ({ className: e }) => /* @__PURE__ */ l("svg", {
|
|
105
107
|
className: e,
|
|
106
108
|
fill: "none",
|
|
107
109
|
viewBox: "0 0 24 24",
|
|
108
110
|
"aria-hidden": "true",
|
|
109
|
-
children: [/* @__PURE__ */
|
|
111
|
+
children: [/* @__PURE__ */ c("circle", {
|
|
110
112
|
className: "opacity-25",
|
|
111
113
|
cx: "12",
|
|
112
114
|
cy: "12",
|
|
113
115
|
r: "10",
|
|
114
116
|
stroke: "currentColor",
|
|
115
117
|
strokeWidth: "4"
|
|
116
|
-
}), /* @__PURE__ */
|
|
118
|
+
}), /* @__PURE__ */ c("path", {
|
|
117
119
|
className: "opacity-75",
|
|
118
120
|
fill: "currentColor",
|
|
119
121
|
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
120
122
|
})]
|
|
121
|
-
}),
|
|
122
|
-
function
|
|
123
|
-
let { t:
|
|
124
|
-
let n =
|
|
123
|
+
}), y = "DELETE MY ACCOUNT";
|
|
124
|
+
function b({ enableAdminRoutes: b = !1 }) {
|
|
125
|
+
let { t: le } = ie(), x = (e, t) => {
|
|
126
|
+
let n = le(e);
|
|
125
127
|
return n === e ? t : n;
|
|
126
|
-
},
|
|
128
|
+
}, S = re(), C = e((e) => e.user), { signOut: w } = t({ disableCurrentUserQuery: !0 }), { deactivateAccount: T, deleteAccount: ue, isDeactivating: E, isDeleting: D } = n(), [de, O] = s(!1), [fe, k] = s(!1), pe = [
|
|
127
129
|
{
|
|
128
|
-
name:
|
|
129
|
-
description:
|
|
130
|
+
name: x("auth.security.navProfile", "User Profile"),
|
|
131
|
+
description: x("auth.security.navProfileDesc", "View and edit your profile information"),
|
|
130
132
|
path: "/auth/profile",
|
|
131
|
-
icon:
|
|
133
|
+
icon: se,
|
|
132
134
|
color: "text-accent-teal",
|
|
133
135
|
bgColor: "bg-accent-teal-subtle"
|
|
134
136
|
},
|
|
135
137
|
{
|
|
136
|
-
name:
|
|
137
|
-
description:
|
|
138
|
+
name: x("auth.security.navMfa", "Two-Factor Authentication"),
|
|
139
|
+
description: x("auth.security.navMfaDesc", "Secure your account with TOTP"),
|
|
138
140
|
path: "/auth/mfa",
|
|
139
|
-
icon:
|
|
141
|
+
icon: p,
|
|
140
142
|
color: "text-accent-purple",
|
|
141
143
|
bgColor: "bg-accent-purple-subtle"
|
|
142
144
|
},
|
|
143
145
|
{
|
|
144
|
-
name:
|
|
145
|
-
description:
|
|
146
|
+
name: x("auth.security.navUsers", "Users"),
|
|
147
|
+
description: x("auth.security.navUsersDesc", "Manage system users"),
|
|
146
148
|
path: "/auth/users",
|
|
147
|
-
icon:
|
|
149
|
+
icon: m,
|
|
148
150
|
color: "text-accent-indigo",
|
|
149
151
|
bgColor: "bg-accent-indigo-subtle",
|
|
150
152
|
adminOnly: !0
|
|
151
153
|
}
|
|
152
|
-
],
|
|
153
|
-
name:
|
|
154
|
-
description:
|
|
154
|
+
], me = [{
|
|
155
|
+
name: x("auth.security.navSso", "SSO Configuration"),
|
|
156
|
+
description: x("auth.security.navSsoDesc", "Enterprise single sign-on"),
|
|
155
157
|
path: "/auth/sso",
|
|
156
|
-
icon:
|
|
158
|
+
icon: ce,
|
|
157
159
|
color: "text-accent-cyan",
|
|
158
160
|
bgColor: "bg-accent-cyan-subtle",
|
|
159
161
|
adminOnly: !0
|
|
160
|
-
}], [
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}, [
|
|
164
|
-
|
|
165
|
-
}, [
|
|
166
|
-
let
|
|
167
|
-
|
|
162
|
+
}], [A, j] = s(!1), [M, N] = s(!1), [P, F] = s(""), [I, L] = s(""), [R, z] = s(null), [B, he] = s(null), V = a(), H = a(), U = a(), W = a(), G = a(), K = a(), q = a(), J = o(null), Y = o(null), X = o(null), Z = o(null);
|
|
163
|
+
i(() => {
|
|
164
|
+
A ? X.current?.focus() : J.current?.focus();
|
|
165
|
+
}, [A]), i(() => {
|
|
166
|
+
M ? Z.current?.focus() : Y.current?.focus();
|
|
167
|
+
}, [M]);
|
|
168
|
+
let ge = async () => {
|
|
169
|
+
O(!0);
|
|
168
170
|
try {
|
|
169
|
-
await
|
|
171
|
+
await w(), S("/auth/login"), k(!1);
|
|
170
172
|
} catch (e) {
|
|
171
|
-
console.error("Logout failed:", e),
|
|
173
|
+
console.error("Logout failed:", e), O(!1);
|
|
172
174
|
}
|
|
173
|
-
},
|
|
174
|
-
|
|
175
|
+
}, _e = async () => {
|
|
176
|
+
z(null);
|
|
175
177
|
try {
|
|
176
|
-
let e = await
|
|
177
|
-
e.success ?
|
|
178
|
+
let e = await T(P);
|
|
179
|
+
e.success ? S("/auth/login", { replace: !0 }) : z(e.message || x("auth.security.deactivateFailed", "Failed to deactivate account"));
|
|
178
180
|
} catch (e) {
|
|
179
|
-
|
|
181
|
+
z(e instanceof Error ? e.message : x("auth.security.deactivateFailed", "Failed to deactivate account"));
|
|
180
182
|
}
|
|
181
|
-
},
|
|
182
|
-
if (
|
|
183
|
-
|
|
183
|
+
}, ve = async () => {
|
|
184
|
+
if (z(null), I !== y) {
|
|
185
|
+
z(x("auth.security.deleteConfirmMismatch", "Please type \"DELETE MY ACCOUNT\" to confirm"));
|
|
184
186
|
return;
|
|
185
187
|
}
|
|
186
|
-
|
|
188
|
+
ne("medium");
|
|
187
189
|
try {
|
|
188
|
-
let e = await
|
|
189
|
-
e.success ? (
|
|
190
|
+
let e = await ue(P, I);
|
|
191
|
+
e.success ? (r("success"), S("/auth/login", { replace: !0 })) : (r("error"), z(e.message || x("auth.security.deleteFailed", "Failed to delete account")));
|
|
190
192
|
} catch (e) {
|
|
191
|
-
|
|
193
|
+
r("error"), z(e instanceof Error ? e.message : x("auth.security.deleteFailed", "Failed to delete account"));
|
|
192
194
|
}
|
|
193
195
|
}, Q = () => {
|
|
194
|
-
|
|
195
|
-
}, $ =
|
|
196
|
-
return /* @__PURE__ */
|
|
196
|
+
j(!1), N(!1), F(""), L(""), z(null), he(null);
|
|
197
|
+
}, $ = C?.role === "SUPER_ADMIN" || C?.role === "TENANT_ADMIN" || C?.role === "ORG_ADMIN", ye = pe.filter((e) => !e.adminOnly || b && $), be = me.filter((e) => !e.adminOnly || b && $);
|
|
198
|
+
return /* @__PURE__ */ l("div", {
|
|
197
199
|
className: "bg-bg-canvas p-6",
|
|
198
|
-
children: [/* @__PURE__ */
|
|
199
|
-
open:
|
|
200
|
-
onOpenChange:
|
|
201
|
-
title:
|
|
202
|
-
description:
|
|
203
|
-
confirmText:
|
|
200
|
+
children: [/* @__PURE__ */ c(te, {
|
|
201
|
+
open: fe,
|
|
202
|
+
onOpenChange: k,
|
|
203
|
+
title: x("auth.security.signOutDialogTitle", "Sign out now?"),
|
|
204
|
+
description: x("auth.security.signOutDialogDescription", "You will be signed out of this device and returned to the login screen."),
|
|
205
|
+
confirmText: x("auth.security.signOutDialogConfirm", "Sign out"),
|
|
204
206
|
variant: "warning",
|
|
205
|
-
isPending:
|
|
206
|
-
onConfirm:
|
|
207
|
-
}), /* @__PURE__ */
|
|
207
|
+
isPending: de,
|
|
208
|
+
onConfirm: ge
|
|
209
|
+
}), /* @__PURE__ */ l("main", {
|
|
208
210
|
className: "max-w-7xl mx-auto space-y-8",
|
|
209
211
|
children: [
|
|
210
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ l("div", {
|
|
211
213
|
className: "flex items-center gap-3",
|
|
212
214
|
"data-tour": "auth-security-header",
|
|
213
|
-
children: [/* @__PURE__ */
|
|
215
|
+
children: [/* @__PURE__ */ c("div", {
|
|
214
216
|
className: "auth-brand-badge flex size-10 items-center justify-center rounded-xl",
|
|
215
|
-
children: /* @__PURE__ */
|
|
216
|
-
}), /* @__PURE__ */
|
|
217
|
+
children: /* @__PURE__ */ c(f, { className: "size-6 text-white" })
|
|
218
|
+
}), /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("h1", {
|
|
217
219
|
className: "text-lg font-bold text-text-primary",
|
|
218
|
-
children:
|
|
219
|
-
}), /* @__PURE__ */
|
|
220
|
+
children: x("auth.security.title", "Security Center")
|
|
221
|
+
}), /* @__PURE__ */ c("p", {
|
|
220
222
|
className: "text-xs text-text-secondary ",
|
|
221
|
-
children:
|
|
223
|
+
children: x("auth.security.subtitle", "Account & Authentication")
|
|
222
224
|
})] })]
|
|
223
225
|
}),
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
|
|
226
|
+
/* @__PURE__ */ c(d, {
|
|
227
|
+
"data-tour": "auth-security-purpose",
|
|
228
|
+
children: x("auth.security.purpose", "Your one place to keep your account safe: turn on two-factor authentication, change your password, review who can act on your behalf, and manage or close your account.")
|
|
229
|
+
}),
|
|
230
|
+
/* @__PURE__ */ c(ae, {
|
|
231
|
+
className: "p-6",
|
|
226
232
|
"data-tour": "auth-security-status-banner",
|
|
227
|
-
children: /* @__PURE__ */
|
|
233
|
+
children: /* @__PURE__ */ l("div", {
|
|
228
234
|
className: "flex flex-col md:flex-row md:items-center md:justify-between gap-4",
|
|
229
|
-
children: [/* @__PURE__ */
|
|
235
|
+
children: [/* @__PURE__ */ l("div", {
|
|
230
236
|
className: "flex items-center gap-4",
|
|
231
|
-
children: [/* @__PURE__ */
|
|
232
|
-
className: "size-14 rounded-2xl bg-
|
|
233
|
-
children: /* @__PURE__ */
|
|
234
|
-
}), /* @__PURE__ */
|
|
235
|
-
className: "text-xl font-bold",
|
|
236
|
-
children:
|
|
237
|
-
}), /* @__PURE__ */
|
|
238
|
-
className: "
|
|
239
|
-
children:
|
|
237
|
+
children: [/* @__PURE__ */ c("div", {
|
|
238
|
+
className: "size-14 rounded-2xl bg-accent-soft flex items-center justify-center",
|
|
239
|
+
children: /* @__PURE__ */ c(f, { className: "size-8 text-[var(--color-action-primary-bg)]" })
|
|
240
|
+
}), /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("h2", {
|
|
241
|
+
className: "text-xl font-bold text-text-primary",
|
|
242
|
+
children: x("auth.security.securityStatus", "Security Status")
|
|
243
|
+
}), /* @__PURE__ */ c("p", {
|
|
244
|
+
className: "text-text-secondary",
|
|
245
|
+
children: C?.mfaEnabled ? x("auth.security.wellProtected", "Your account is well protected") : x("auth.security.enableMfaSuggestion", "Enable MFA for better security")
|
|
240
246
|
})] })]
|
|
241
|
-
}), /* @__PURE__ */
|
|
247
|
+
}), /* @__PURE__ */ c("div", {
|
|
242
248
|
className: "flex items-center gap-3",
|
|
243
|
-
children:
|
|
244
|
-
className: "inline-flex items-center gap-2 px-4 py-2 rounded-xl bg-bg-
|
|
245
|
-
children: [/* @__PURE__ */
|
|
246
|
-
}) : /* @__PURE__ */
|
|
249
|
+
children: C?.mfaEnabled ? /* @__PURE__ */ l("span", {
|
|
250
|
+
className: "inline-flex items-center gap-2 px-4 py-2 rounded-xl bg-status-success-bg-subtle text-status-success-text font-medium",
|
|
251
|
+
children: [/* @__PURE__ */ c(g, { className: "size-5 text-status-success-text" }), x("auth.security.mfaEnabled", "MFA Enabled")]
|
|
252
|
+
}) : /* @__PURE__ */ l(u, {
|
|
247
253
|
type: "button",
|
|
248
|
-
onClick: () =>
|
|
249
|
-
|
|
250
|
-
|
|
254
|
+
onClick: () => S("/auth/mfa"),
|
|
255
|
+
variant: "default",
|
|
256
|
+
className: "font-semibold",
|
|
257
|
+
children: [/* @__PURE__ */ c(_, { className: "size-5" }), x("auth.security.enableMfaNow", "Enable MFA Now")]
|
|
251
258
|
})
|
|
252
259
|
})]
|
|
253
260
|
})
|
|
254
261
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ l("div", {
|
|
256
263
|
className: "mb-8 p-6 rounded-2xl bg-bg-surface border border-border-subtle shadow-sm",
|
|
257
264
|
"data-tour": "auth-account-info-card",
|
|
258
|
-
children: [/* @__PURE__ */
|
|
265
|
+
children: [/* @__PURE__ */ c("h3", {
|
|
259
266
|
className: "text-lg font-semibold text-text-primary mb-4",
|
|
260
|
-
children:
|
|
261
|
-
}), /* @__PURE__ */
|
|
267
|
+
children: x("auth.security.accountInfo", "Account Information")
|
|
268
|
+
}), /* @__PURE__ */ l("dl", {
|
|
262
269
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6",
|
|
263
270
|
children: [
|
|
264
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ l("div", {
|
|
265
272
|
className: "sm:col-span-2 lg:col-span-1",
|
|
266
|
-
children: [/* @__PURE__ */
|
|
273
|
+
children: [/* @__PURE__ */ c("dt", {
|
|
267
274
|
className: "text-sm font-medium text-text-secondary",
|
|
268
|
-
children:
|
|
269
|
-
}), /* @__PURE__ */
|
|
275
|
+
children: x("auth.security.email", "Email")
|
|
276
|
+
}), /* @__PURE__ */ l("dd", {
|
|
270
277
|
className: "mt-1 text-text-primary",
|
|
271
|
-
children: [/* @__PURE__ */
|
|
278
|
+
children: [/* @__PURE__ */ c("span", {
|
|
272
279
|
className: "block truncate",
|
|
273
|
-
title:
|
|
274
|
-
children:
|
|
275
|
-
}),
|
|
280
|
+
title: C?.email,
|
|
281
|
+
children: C?.email
|
|
282
|
+
}), C?.emailVerified && /* @__PURE__ */ l("span", {
|
|
276
283
|
className: "mt-1 inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-status-success-bg-subtle text-status-success-text text-xs font-medium",
|
|
277
|
-
children: [/* @__PURE__ */
|
|
284
|
+
children: [/* @__PURE__ */ c(g, { className: "size-3" }), x("auth.security.verified", "Verified")]
|
|
278
285
|
})]
|
|
279
286
|
})]
|
|
280
287
|
}),
|
|
281
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("dt", {
|
|
282
289
|
className: "text-sm font-medium text-text-secondary",
|
|
283
|
-
children:
|
|
284
|
-
}), /* @__PURE__ */
|
|
290
|
+
children: x("auth.security.username", "Username")
|
|
291
|
+
}), /* @__PURE__ */ c("dd", {
|
|
285
292
|
className: "mt-1 text-text-primary truncate",
|
|
286
|
-
title:
|
|
287
|
-
children:
|
|
293
|
+
title: C?.username ?? void 0,
|
|
294
|
+
children: C?.username || "-"
|
|
288
295
|
})] }),
|
|
289
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("dt", {
|
|
290
297
|
className: "text-sm font-medium text-text-secondary",
|
|
291
|
-
children:
|
|
292
|
-
}), /* @__PURE__ */
|
|
298
|
+
children: x("auth.security.role", "Role")
|
|
299
|
+
}), /* @__PURE__ */ c("dd", {
|
|
293
300
|
className: "mt-1",
|
|
294
|
-
children: /* @__PURE__ */
|
|
301
|
+
children: /* @__PURE__ */ c("span", {
|
|
295
302
|
className: "inline-flex px-2.5 py-0.5 rounded-full bg-accent-indigo-subtle text-accent-indigo text-xs font-medium",
|
|
296
|
-
children:
|
|
303
|
+
children: C?.role || "USER"
|
|
297
304
|
})
|
|
298
305
|
})] }),
|
|
299
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("dt", {
|
|
300
307
|
className: "text-sm font-medium text-text-secondary",
|
|
301
|
-
children:
|
|
302
|
-
}), /* @__PURE__ */
|
|
308
|
+
children: x("auth.security.memberSince", "Member Since")
|
|
309
|
+
}), /* @__PURE__ */ c("dd", {
|
|
303
310
|
className: "mt-1 text-text-primary",
|
|
304
|
-
children:
|
|
311
|
+
children: C?.createdAt ? ee(C.createdAt) : "-"
|
|
305
312
|
})] })
|
|
306
313
|
]
|
|
307
314
|
})]
|
|
308
315
|
}),
|
|
309
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ l("div", {
|
|
310
317
|
className: "mb-8",
|
|
311
|
-
children: [/* @__PURE__ */
|
|
318
|
+
children: [/* @__PURE__ */ c("h3", {
|
|
312
319
|
className: "text-lg font-semibold text-text-primary mb-4",
|
|
313
|
-
children:
|
|
314
|
-
}), /* @__PURE__ */
|
|
320
|
+
children: x("auth.security.securityAuth", "Security & Authentication")
|
|
321
|
+
}), /* @__PURE__ */ c("div", {
|
|
315
322
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",
|
|
316
323
|
"data-tour": "auth-security-nav-grid",
|
|
317
|
-
children:
|
|
324
|
+
children: ye.map((e) => /* @__PURE__ */ c("button", {
|
|
318
325
|
type: "button",
|
|
319
|
-
onClick: () =>
|
|
326
|
+
onClick: () => S(e.path),
|
|
320
327
|
"aria-label": e.name,
|
|
321
328
|
className: "group relative p-5 rounded-2xl bg-bg-surface border border-border-subtle hover:border-border-default hover:shadow-lg transition-all duration-200 text-left",
|
|
322
|
-
children: /* @__PURE__ */
|
|
329
|
+
children: /* @__PURE__ */ l("div", {
|
|
323
330
|
className: "flex items-start gap-4",
|
|
324
331
|
children: [
|
|
325
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ c("div", {
|
|
326
333
|
className: `size-12 rounded-xl ${e.bgColor} flex items-center justify-center flex-shrink-0 transition-transform`,
|
|
327
|
-
children: /* @__PURE__ */
|
|
334
|
+
children: /* @__PURE__ */ c(e.icon, { className: `size-6 ${e.color}` })
|
|
328
335
|
}),
|
|
329
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ l("div", {
|
|
330
337
|
className: "flex-1 min-w-0",
|
|
331
|
-
children: [/* @__PURE__ */
|
|
338
|
+
children: [/* @__PURE__ */ c("h4", {
|
|
332
339
|
className: "text-base font-semibold text-text-primary group-hover:text-accent-indigo transition-colors",
|
|
333
340
|
children: e.name
|
|
334
|
-
}), /* @__PURE__ */
|
|
341
|
+
}), /* @__PURE__ */ c("p", {
|
|
335
342
|
className: "mt-1 text-sm text-text-secondary ",
|
|
336
343
|
children: e.description
|
|
337
344
|
})]
|
|
338
345
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ c(h, { className: "size-5 text-text-tertiary group-hover:text-indigo-500 transition-colors flex-shrink-0" })
|
|
340
347
|
]
|
|
341
348
|
})
|
|
342
349
|
}, e.path))
|
|
343
350
|
})]
|
|
344
351
|
}),
|
|
345
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ l("div", {
|
|
346
353
|
className: "mb-8",
|
|
347
|
-
children: [/* @__PURE__ */
|
|
354
|
+
children: [/* @__PURE__ */ c("h3", {
|
|
348
355
|
className: "text-lg font-semibold text-text-primary mb-4",
|
|
349
|
-
children:
|
|
350
|
-
}), /* @__PURE__ */
|
|
356
|
+
children: x("auth.security.quickActions", "Quick Actions")
|
|
357
|
+
}), /* @__PURE__ */ c("div", {
|
|
351
358
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
352
|
-
children:
|
|
359
|
+
children: be.map((e) => /* @__PURE__ */ c("button", {
|
|
353
360
|
type: "button",
|
|
354
|
-
onClick: () =>
|
|
361
|
+
onClick: () => S(e.path),
|
|
355
362
|
"aria-label": e.name,
|
|
356
363
|
className: "group relative p-5 rounded-2xl bg-bg-surface border border-border-subtle hover:border-border-default hover:shadow-lg transition-all duration-200 text-left",
|
|
357
|
-
children: /* @__PURE__ */
|
|
364
|
+
children: /* @__PURE__ */ l("div", {
|
|
358
365
|
className: "flex items-start gap-4",
|
|
359
366
|
children: [
|
|
360
|
-
/* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ c("div", {
|
|
361
368
|
className: `size-12 rounded-xl ${e.bgColor} flex items-center justify-center flex-shrink-0 transition-transform`,
|
|
362
|
-
children: /* @__PURE__ */
|
|
369
|
+
children: /* @__PURE__ */ c(e.icon, { className: `size-6 ${e.color}` })
|
|
363
370
|
}),
|
|
364
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ l("div", {
|
|
365
372
|
className: "flex-1 min-w-0",
|
|
366
|
-
children: [/* @__PURE__ */
|
|
373
|
+
children: [/* @__PURE__ */ c("h4", {
|
|
367
374
|
className: "text-base font-semibold text-text-primary group-hover:text-accent-indigo transition-colors",
|
|
368
375
|
children: e.name
|
|
369
|
-
}), /* @__PURE__ */
|
|
376
|
+
}), /* @__PURE__ */ c("p", {
|
|
370
377
|
className: "mt-1 text-sm text-text-secondary ",
|
|
371
378
|
children: e.description
|
|
372
379
|
})]
|
|
373
380
|
}),
|
|
374
|
-
/* @__PURE__ */
|
|
381
|
+
/* @__PURE__ */ c(h, { className: "size-5 text-text-tertiary group-hover:text-indigo-500 transition-colors flex-shrink-0" })
|
|
375
382
|
]
|
|
376
383
|
})
|
|
377
384
|
}, e.path))
|
|
378
385
|
})]
|
|
379
386
|
}),
|
|
380
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ l("div", {
|
|
381
388
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
382
|
-
children: [/* @__PURE__ */
|
|
389
|
+
children: [/* @__PURE__ */ l("div", {
|
|
383
390
|
className: "p-6 rounded-2xl bg-bg-surface border border-border-subtle",
|
|
384
391
|
"data-tour": "auth-password-section",
|
|
385
|
-
children: [/* @__PURE__ */
|
|
392
|
+
children: [/* @__PURE__ */ c("div", {
|
|
386
393
|
className: "flex items-start justify-between",
|
|
387
|
-
children: /* @__PURE__ */
|
|
388
|
-
/* @__PURE__ */
|
|
394
|
+
children: /* @__PURE__ */ l("div", { children: [
|
|
395
|
+
/* @__PURE__ */ c("h3", {
|
|
389
396
|
className: "text-lg font-semibold text-text-primary",
|
|
390
|
-
children:
|
|
397
|
+
children: x("auth.security.password", "Password")
|
|
391
398
|
}),
|
|
392
|
-
/* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ c("p", {
|
|
393
400
|
className: "mt-1 text-sm text-text-secondary ",
|
|
394
|
-
children:
|
|
401
|
+
children: x("auth.security.updatePassword", "Update your password to keep your account secure")
|
|
395
402
|
}),
|
|
396
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ c("p", {
|
|
397
404
|
className: "mt-2 text-xs text-text-tertiary ",
|
|
398
|
-
children:
|
|
405
|
+
children: x("auth.security.lastChanged", "Last changed: Never")
|
|
399
406
|
})
|
|
400
407
|
] })
|
|
401
|
-
}), /* @__PURE__ */ u
|
|
408
|
+
}), /* @__PURE__ */ c(u, {
|
|
402
409
|
type: "button",
|
|
403
|
-
onClick: () =>
|
|
404
|
-
|
|
405
|
-
|
|
410
|
+
onClick: () => S("/auth/reset-password"),
|
|
411
|
+
variant: "default",
|
|
412
|
+
className: "mt-4 w-full font-semibold sm:w-auto",
|
|
413
|
+
children: x("auth.security.changePassword", "Change Password")
|
|
406
414
|
})]
|
|
407
|
-
}), /* @__PURE__ */
|
|
415
|
+
}), /* @__PURE__ */ l("div", {
|
|
408
416
|
className: "p-6 rounded-2xl bg-status-error-bg-subtle border border-status-error-border",
|
|
409
417
|
"data-tour": "auth-danger-zone",
|
|
410
418
|
children: [
|
|
411
|
-
/* @__PURE__ */
|
|
419
|
+
/* @__PURE__ */ c("h3", {
|
|
412
420
|
className: "text-lg font-semibold text-status-error-text",
|
|
413
|
-
children:
|
|
421
|
+
children: x("auth.security.dangerZone", "Danger Zone")
|
|
414
422
|
}),
|
|
415
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ c("p", {
|
|
416
424
|
className: "mt-1 text-sm text-status-error-text/80",
|
|
417
|
-
children:
|
|
425
|
+
children: x("auth.security.dangerWarning", "These actions affect your account. Proceed with caution.")
|
|
418
426
|
}),
|
|
419
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ l("div", {
|
|
420
428
|
className: "mt-4 flex flex-wrap gap-3",
|
|
421
|
-
children: [/* @__PURE__ */
|
|
429
|
+
children: [/* @__PURE__ */ c("button", {
|
|
422
430
|
ref: J,
|
|
423
431
|
type: "button",
|
|
424
|
-
onClick: () =>
|
|
432
|
+
onClick: () => j(!0),
|
|
425
433
|
className: "px-5 py-2.5 rounded-xl border-2 border-status-warning-border text-status-warning-text font-semibold hover:bg-status-warning-bg-subtle transition-all duration-200",
|
|
426
|
-
children:
|
|
427
|
-
}), /* @__PURE__ */
|
|
434
|
+
children: x("auth.security.deactivateAccount", "Deactivate Account")
|
|
435
|
+
}), /* @__PURE__ */ c("button", {
|
|
428
436
|
ref: Y,
|
|
429
437
|
type: "button",
|
|
430
|
-
onClick: () =>
|
|
438
|
+
onClick: () => N(!0),
|
|
431
439
|
className: "px-5 py-2.5 rounded-xl border-2 border-status-error-border text-status-error-text font-semibold hover:bg-status-error-bg-subtle transition-all duration-200",
|
|
432
|
-
children:
|
|
440
|
+
children: x("auth.security.deleteAccount", "Delete Account")
|
|
433
441
|
})]
|
|
434
442
|
})
|
|
435
443
|
]
|
|
436
444
|
})]
|
|
437
445
|
}),
|
|
438
|
-
|
|
446
|
+
A && /* @__PURE__ */ c("div", {
|
|
439
447
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",
|
|
440
448
|
role: "presentation",
|
|
441
449
|
onClick: (e) => {
|
|
442
450
|
e.target === e.currentTarget && Q();
|
|
443
451
|
},
|
|
444
|
-
children: /* @__PURE__ */
|
|
452
|
+
children: /* @__PURE__ */ l("div", {
|
|
445
453
|
ref: X,
|
|
446
454
|
role: "dialog",
|
|
447
455
|
"aria-modal": "true",
|
|
@@ -449,70 +457,70 @@ function v({ enableAdminRoutes: v = !1 }) {
|
|
|
449
457
|
tabIndex: -1,
|
|
450
458
|
className: "w-full max-w-md bg-bg-surface rounded-2xl shadow-2xl p-6 outline-none",
|
|
451
459
|
children: [
|
|
452
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ c("h3", {
|
|
453
461
|
id: V,
|
|
454
462
|
className: "text-xl font-bold text-text-primary mb-2",
|
|
455
|
-
children:
|
|
463
|
+
children: x("auth.security.deactivateTitle", "Deactivate Account")
|
|
456
464
|
}),
|
|
457
|
-
/* @__PURE__ */
|
|
465
|
+
/* @__PURE__ */ c("p", {
|
|
458
466
|
className: "text-sm text-text-secondary mb-4",
|
|
459
|
-
children:
|
|
467
|
+
children: x("auth.security.deactivateDesc", "Your account will be temporarily disabled. You can reactivate it by signing in again with your credentials.")
|
|
460
468
|
}),
|
|
461
|
-
|
|
469
|
+
R && /* @__PURE__ */ c("div", {
|
|
462
470
|
id: U,
|
|
463
471
|
role: "alert",
|
|
464
472
|
className: "mb-4 p-3 rounded-lg bg-status-error-bg-subtle text-status-error-text text-sm",
|
|
465
|
-
children:
|
|
473
|
+
children: R
|
|
466
474
|
}),
|
|
467
|
-
|
|
475
|
+
B && /* @__PURE__ */ c("output", {
|
|
468
476
|
className: "block mb-4 p-3 rounded-lg bg-status-success-bg-subtle text-status-success-text text-sm",
|
|
469
|
-
children:
|
|
477
|
+
children: B
|
|
470
478
|
}),
|
|
471
|
-
/* @__PURE__ */
|
|
479
|
+
/* @__PURE__ */ l("div", {
|
|
472
480
|
className: "mb-4",
|
|
473
|
-
children: [/* @__PURE__ */
|
|
481
|
+
children: [/* @__PURE__ */ c("label", {
|
|
474
482
|
htmlFor: H,
|
|
475
483
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
476
|
-
children:
|
|
477
|
-
}), /* @__PURE__ */
|
|
484
|
+
children: x("auth.security.enterPasswordConfirm", "Enter your password to confirm")
|
|
485
|
+
}), /* @__PURE__ */ c("input", {
|
|
478
486
|
id: H,
|
|
479
487
|
type: "password",
|
|
480
|
-
value:
|
|
481
|
-
onChange: (e) =>
|
|
488
|
+
value: P,
|
|
489
|
+
onChange: (e) => F(e.target.value),
|
|
482
490
|
"aria-required": "true",
|
|
483
|
-
"aria-label":
|
|
484
|
-
"aria-describedby":
|
|
485
|
-
"aria-invalid": !!
|
|
491
|
+
"aria-label": x("auth.security.enterPasswordConfirm", "Enter your password to confirm"),
|
|
492
|
+
"aria-describedby": R ? U : void 0,
|
|
493
|
+
"aria-invalid": !!R,
|
|
486
494
|
autoComplete: "current-password",
|
|
487
495
|
className: "w-full px-4 py-2 rounded-lg border border-border-default bg-bg-surface text-text-primary focus:ring-2 focus:ring-status-warning-bg focus:border-transparent",
|
|
488
|
-
placeholder:
|
|
496
|
+
placeholder: x("auth.security.yourPassword", "Your password")
|
|
489
497
|
})]
|
|
490
498
|
}),
|
|
491
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ l("div", {
|
|
492
500
|
className: "flex gap-3",
|
|
493
|
-
children: [/* @__PURE__ */
|
|
501
|
+
children: [/* @__PURE__ */ c("button", {
|
|
494
502
|
type: "button",
|
|
495
503
|
onClick: Q,
|
|
496
504
|
className: "flex-1 px-4 py-2 rounded-lg border border-border-default text-text-primary font-medium hover:bg-bg-sunken transition-colors",
|
|
497
|
-
children:
|
|
498
|
-
}), /* @__PURE__ */
|
|
505
|
+
children: x("auth.security.cancel", "Cancel")
|
|
506
|
+
}), /* @__PURE__ */ l("button", {
|
|
499
507
|
type: "button",
|
|
500
|
-
onClick: () => void
|
|
501
|
-
disabled: !
|
|
508
|
+
onClick: () => void _e(),
|
|
509
|
+
disabled: !P || E,
|
|
502
510
|
className: "flex-1 px-4 py-2 rounded-lg bg-status-warning-bg text-white font-medium hover:bg-status-warning-bg-hover disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center justify-center gap-2",
|
|
503
|
-
children: [
|
|
511
|
+
children: [E && /* @__PURE__ */ c(v, { className: "size-4 animate-spin" }), x("auth.security.deactivateBtn", "Deactivate")]
|
|
504
512
|
})]
|
|
505
513
|
})
|
|
506
514
|
]
|
|
507
515
|
})
|
|
508
516
|
}),
|
|
509
|
-
|
|
517
|
+
M && /* @__PURE__ */ c("div", {
|
|
510
518
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",
|
|
511
519
|
role: "presentation",
|
|
512
520
|
onClick: (e) => {
|
|
513
521
|
e.target === e.currentTarget && Q();
|
|
514
522
|
},
|
|
515
|
-
children: /* @__PURE__ */
|
|
523
|
+
children: /* @__PURE__ */ l("div", {
|
|
516
524
|
ref: Z,
|
|
517
525
|
role: "dialog",
|
|
518
526
|
"aria-modal": "true",
|
|
@@ -520,123 +528,146 @@ function v({ enableAdminRoutes: v = !1 }) {
|
|
|
520
528
|
tabIndex: -1,
|
|
521
529
|
className: "w-full max-w-md bg-bg-surface rounded-2xl shadow-2xl p-6 outline-none",
|
|
522
530
|
children: [
|
|
523
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ c("h3", {
|
|
524
532
|
id: W,
|
|
525
533
|
className: "text-xl font-bold text-status-error-text mb-2",
|
|
526
|
-
children:
|
|
534
|
+
children: x("auth.security.deleteTitle", "Delete Account Permanently")
|
|
527
535
|
}),
|
|
528
|
-
/* @__PURE__ */
|
|
536
|
+
/* @__PURE__ */ c("p", {
|
|
529
537
|
className: "text-sm text-text-secondary mb-4",
|
|
530
|
-
children:
|
|
538
|
+
children: x("auth.security.deleteDesc", "This action is irreversible. All your data will be permanently deleted and cannot be recovered.")
|
|
531
539
|
}),
|
|
532
|
-
|
|
540
|
+
R && /* @__PURE__ */ c("div", {
|
|
533
541
|
id: q,
|
|
534
542
|
role: "alert",
|
|
535
543
|
className: "mb-4 p-3 rounded-lg bg-status-error-bg-subtle text-status-error-text text-sm",
|
|
536
|
-
children:
|
|
544
|
+
children: R
|
|
537
545
|
}),
|
|
538
|
-
|
|
546
|
+
B && /* @__PURE__ */ c("output", {
|
|
539
547
|
className: "block mb-4 p-3 rounded-lg bg-status-success-bg-subtle text-status-success-text text-sm",
|
|
540
|
-
children:
|
|
548
|
+
children: B
|
|
541
549
|
}),
|
|
542
|
-
/* @__PURE__ */
|
|
550
|
+
/* @__PURE__ */ l("div", {
|
|
543
551
|
className: "mb-4",
|
|
544
|
-
children: [/* @__PURE__ */
|
|
552
|
+
children: [/* @__PURE__ */ c("label", {
|
|
545
553
|
htmlFor: G,
|
|
546
554
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
547
|
-
children:
|
|
548
|
-
}), /* @__PURE__ */
|
|
555
|
+
children: x("auth.security.enterPasswordDelete", "Enter your password")
|
|
556
|
+
}), /* @__PURE__ */ c("input", {
|
|
549
557
|
id: G,
|
|
550
558
|
type: "password",
|
|
551
|
-
value:
|
|
552
|
-
onChange: (e) =>
|
|
559
|
+
value: P,
|
|
560
|
+
onChange: (e) => F(e.target.value),
|
|
553
561
|
"aria-required": "true",
|
|
554
|
-
"aria-label":
|
|
555
|
-
"aria-describedby":
|
|
556
|
-
"aria-invalid": !!
|
|
562
|
+
"aria-label": x("auth.security.enterPasswordDelete", "Enter your password"),
|
|
563
|
+
"aria-describedby": R ? q : void 0,
|
|
564
|
+
"aria-invalid": !!R,
|
|
557
565
|
autoComplete: "current-password",
|
|
558
566
|
className: "w-full px-4 py-2 rounded-lg border border-border-default bg-bg-surface text-text-primary focus:ring-2 focus:ring-status-error-bg focus:border-transparent",
|
|
559
|
-
placeholder:
|
|
567
|
+
placeholder: x("auth.security.yourPassword", "Your password")
|
|
560
568
|
})]
|
|
561
569
|
}),
|
|
562
|
-
/* @__PURE__ */
|
|
570
|
+
/* @__PURE__ */ l("div", {
|
|
563
571
|
className: "mb-4",
|
|
564
|
-
children: [/* @__PURE__ */
|
|
572
|
+
children: [/* @__PURE__ */ l("label", {
|
|
565
573
|
htmlFor: K,
|
|
566
574
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
567
575
|
children: [
|
|
568
|
-
|
|
576
|
+
x("auth.security.type", "Type"),
|
|
569
577
|
" ",
|
|
570
|
-
/* @__PURE__ */
|
|
578
|
+
/* @__PURE__ */ c("code", {
|
|
571
579
|
className: "px-1 py-0.5 rounded bg-bg-sunken text-status-error-text font-mono text-sm",
|
|
572
|
-
children:
|
|
580
|
+
children: y
|
|
573
581
|
}),
|
|
574
582
|
" ",
|
|
575
|
-
|
|
583
|
+
x("auth.security.toConfirm", "to confirm")
|
|
576
584
|
]
|
|
577
|
-
}), /* @__PURE__ */
|
|
585
|
+
}), /* @__PURE__ */ c("input", {
|
|
578
586
|
id: K,
|
|
579
587
|
type: "text",
|
|
580
|
-
value:
|
|
581
|
-
onChange: (e) =>
|
|
588
|
+
value: I,
|
|
589
|
+
onChange: (e) => L(e.target.value),
|
|
582
590
|
"aria-required": "true",
|
|
583
|
-
"aria-label":
|
|
584
|
-
"aria-describedby":
|
|
585
|
-
"aria-invalid":
|
|
591
|
+
"aria-label": x("auth.security.deleteConfirmAriaLabel", "Type DELETE MY ACCOUNT to confirm"),
|
|
592
|
+
"aria-describedby": R ? q : void 0,
|
|
593
|
+
"aria-invalid": I.length > 0 && I !== y,
|
|
586
594
|
autoComplete: "off",
|
|
587
595
|
className: "w-full px-4 py-2 rounded-lg border border-border-default bg-bg-surface text-text-primary focus:ring-2 focus:ring-status-error-bg focus:border-transparent font-mono",
|
|
588
|
-
placeholder:
|
|
596
|
+
placeholder: x("auth.security.deleteConfirmPlaceholder", "DELETE MY ACCOUNT")
|
|
589
597
|
})]
|
|
590
598
|
}),
|
|
591
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ l("div", {
|
|
592
600
|
className: "flex gap-3",
|
|
593
|
-
children: [/* @__PURE__ */
|
|
601
|
+
children: [/* @__PURE__ */ c("button", {
|
|
594
602
|
type: "button",
|
|
595
603
|
onClick: Q,
|
|
596
604
|
className: "flex-1 px-4 py-2 rounded-lg border border-border-default text-text-primary font-medium hover:bg-bg-sunken transition-colors",
|
|
597
|
-
children:
|
|
598
|
-
}), /* @__PURE__ */
|
|
605
|
+
children: x("auth.security.cancel", "Cancel")
|
|
606
|
+
}), /* @__PURE__ */ l("button", {
|
|
599
607
|
type: "button",
|
|
600
|
-
onClick: () => void
|
|
601
|
-
disabled: !
|
|
608
|
+
onClick: () => void ve(),
|
|
609
|
+
disabled: !P || I !== y || D,
|
|
602
610
|
className: "flex-1 px-4 py-2 rounded-lg bg-status-error-bg text-white font-medium hover:bg-status-error-bg-hover disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center justify-center gap-2",
|
|
603
|
-
children: [
|
|
611
|
+
children: [D && /* @__PURE__ */ c(v, { className: "size-4 animate-spin" }), x("auth.security.deleteForever", "Delete Forever")]
|
|
604
612
|
})]
|
|
605
613
|
})
|
|
606
614
|
]
|
|
607
615
|
})
|
|
608
616
|
}),
|
|
609
|
-
/* @__PURE__ */
|
|
617
|
+
/* @__PURE__ */ c(oe, {
|
|
618
|
+
storageKey: "auth-security",
|
|
619
|
+
steps: [
|
|
620
|
+
...C?.mfaEnabled ? [] : [{
|
|
621
|
+
id: "enable-mfa",
|
|
622
|
+
label: x("auth.security.nextEnableMfa", "Turn on two-factor authentication"),
|
|
623
|
+
description: x("auth.security.nextEnableMfaDesc", "The single biggest step you can take to protect your account."),
|
|
624
|
+
onClick: () => S("/auth/mfa")
|
|
625
|
+
}],
|
|
626
|
+
{
|
|
627
|
+
id: "review-profile",
|
|
628
|
+
label: x("auth.security.nextProfile", "Review your profile details"),
|
|
629
|
+
description: x("auth.security.nextProfileDesc", "Make sure your name, email, and contact info are current."),
|
|
630
|
+
onClick: () => S("/auth/profile")
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
id: "change-password",
|
|
634
|
+
label: x("auth.security.nextPassword", "Update your password"),
|
|
635
|
+
description: x("auth.security.nextPasswordDesc", "Set a strong, unique password if you haven't recently."),
|
|
636
|
+
onClick: () => S("/auth/reset-password")
|
|
637
|
+
}
|
|
638
|
+
]
|
|
639
|
+
}),
|
|
640
|
+
/* @__PURE__ */ c("footer", {
|
|
610
641
|
className: "mt-12 pt-6 border-t border-border-subtle ",
|
|
611
|
-
children: /* @__PURE__ */
|
|
642
|
+
children: /* @__PURE__ */ l("div", {
|
|
612
643
|
className: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 text-sm text-text-secondary ",
|
|
613
644
|
"data-tour": "auth-footer-actions",
|
|
614
|
-
children: [/* @__PURE__ */
|
|
615
|
-
|
|
645
|
+
children: [/* @__PURE__ */ l("p", { children: [
|
|
646
|
+
x("auth.security.signedInAs", "Signed in as"),
|
|
616
647
|
" ",
|
|
617
|
-
/* @__PURE__ */
|
|
648
|
+
/* @__PURE__ */ c("span", {
|
|
618
649
|
className: "font-medium text-text-primary ",
|
|
619
|
-
children:
|
|
650
|
+
children: C?.email
|
|
620
651
|
})
|
|
621
|
-
] }), /* @__PURE__ */
|
|
652
|
+
] }), /* @__PURE__ */ l("div", {
|
|
622
653
|
className: "flex items-center gap-4",
|
|
623
654
|
children: [
|
|
624
|
-
/* @__PURE__ */
|
|
655
|
+
/* @__PURE__ */ c("button", {
|
|
625
656
|
type: "button",
|
|
626
|
-
onClick: () =>
|
|
657
|
+
onClick: () => S("/auth/login"),
|
|
627
658
|
className: "hover:text-text-primary transition-colors",
|
|
628
|
-
children:
|
|
659
|
+
children: x("auth.security.switchAccount", "Switch Account")
|
|
629
660
|
}),
|
|
630
|
-
/* @__PURE__ */
|
|
661
|
+
/* @__PURE__ */ c("span", {
|
|
631
662
|
className: "text-text-muted",
|
|
632
663
|
"aria-hidden": "true",
|
|
633
664
|
children: "|"
|
|
634
665
|
}),
|
|
635
|
-
/* @__PURE__ */
|
|
666
|
+
/* @__PURE__ */ c("button", {
|
|
636
667
|
type: "button",
|
|
637
|
-
onClick: () =>
|
|
668
|
+
onClick: () => k(!0),
|
|
638
669
|
className: "hover:text-status-error-text transition-colors",
|
|
639
|
-
children:
|
|
670
|
+
children: x("auth.security.signOut", "Sign Out")
|
|
640
671
|
})
|
|
641
672
|
]
|
|
642
673
|
})]
|
|
@@ -647,6 +678,6 @@ function v({ enableAdminRoutes: v = !1 }) {
|
|
|
647
678
|
});
|
|
648
679
|
}
|
|
649
680
|
//#endregion
|
|
650
|
-
export {
|
|
681
|
+
export { b as SecurityPage };
|
|
651
682
|
|
|
652
683
|
//# sourceMappingURL=SecurityPage.js.map
|