@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.
Files changed (41) hide show
  1. package/dist/auth/hooks/index.js +1 -0
  2. package/dist/auth/hooks/useActiveContextBootstrapMirror.js +27 -0
  3. package/dist/auth/hooks/useActiveContextBootstrapMirror.js.map +1 -0
  4. package/dist/auth/index.js +1 -0
  5. package/dist/auth/pages/AuditLogPage.js +73 -72
  6. package/dist/auth/pages/AuditLogPage.js.map +1 -1
  7. package/dist/auth/pages/EmailVerifyPage.js +58 -53
  8. package/dist/auth/pages/EmailVerifyPage.js.map +1 -1
  9. package/dist/auth/pages/LoginPage.js +222 -214
  10. package/dist/auth/pages/LoginPage.js.map +1 -1
  11. package/dist/auth/pages/MagicLinkPage.js +75 -68
  12. package/dist/auth/pages/MagicLinkPage.js.map +1 -1
  13. package/dist/auth/pages/MfaSetupPage.js +176 -138
  14. package/dist/auth/pages/MfaSetupPage.js.map +1 -1
  15. package/dist/auth/pages/MfaVerifyPage.js +60 -52
  16. package/dist/auth/pages/MfaVerifyPage.js.map +1 -1
  17. package/dist/auth/pages/PasswordResetPage.js +277 -262
  18. package/dist/auth/pages/PasswordResetPage.js.map +1 -1
  19. package/dist/auth/pages/ReactivatePage.js +54 -46
  20. package/dist/auth/pages/ReactivatePage.js.map +1 -1
  21. package/dist/auth/pages/RegisterPage.js +223 -213
  22. package/dist/auth/pages/RegisterPage.js.map +1 -1
  23. package/dist/auth/pages/SecurityPage.js +298 -267
  24. package/dist/auth/pages/SecurityPage.js.map +1 -1
  25. package/dist/auth/pages/SessionsPage.js +169 -160
  26. package/dist/auth/pages/SessionsPage.js.map +1 -1
  27. package/dist/auth/pages/SsoCallbackPage.js +53 -50
  28. package/dist/auth/pages/SsoCallbackPage.js.map +1 -1
  29. package/dist/auth/pages/SsoConfigPage.js +466 -444
  30. package/dist/auth/pages/SsoConfigPage.js.map +1 -1
  31. package/dist/auth/pages/SsoLoginPage.js +67 -59
  32. package/dist/auth/pages/SsoLoginPage.js.map +1 -1
  33. package/dist/auth/pages/UserDetailsPage.js +154 -144
  34. package/dist/auth/pages/UserDetailsPage.js.map +1 -1
  35. package/dist/auth/pages/UserProfilePage.js +211 -170
  36. package/dist/auth/pages/UserProfilePage.js.map +1 -1
  37. package/dist/auth/pages/UsersPage.js +572 -576
  38. package/dist/auth/pages/UsersPage.js.map +1 -1
  39. package/dist/index.js +7 -6
  40. package/dist/microfe-auth.css +1 -1
  41. package/package.json +2 -2
@@ -5,119 +5,129 @@ import { QRCodeSVG as i } from "../../node_modules/qrcode.react/lib/esm/index.js
5
5
  import { ConfirmActionDialog as a } from "../components/ConfirmActionDialog.js";
6
6
  import { nativeCopyText as o, nativeImpact as s, nativeNotify as c } from "../../utils/nativeBridge.js";
7
7
  import { useState as l } from "react";
8
- import { useI18n as u } from "@burdenoff/fe-libs/shared/providers/shell";
9
- import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
8
+ import { useNavigate as u } from "react-router-dom";
9
+ import { useI18n as d } from "@burdenoff/fe-libs/shared/providers/shell";
10
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
11
+ import { Button as h } from "@burdenoff/fe-libs/button";
12
+ import { NextSteps as g, PagePurpose as _ } from "@burdenoff/fe-libs/ui";
10
13
  //#region src/auth/pages/MfaSetupPage.tsx
11
- function m() {
12
- let { t: m } = u(), h = (e, t) => {
13
- let n = m(e);
14
+ function v() {
15
+ let { t: v } = d(), y = (e, t) => {
16
+ let n = v(e);
14
17
  return n === e ? t : n;
15
- }, { setupMFA: g, enableMFA: _, disableMFA: v, isLoading: y } = r(), b = e((e) => e.user), x = e((e) => e.isAuthenticated), [S, C] = l(null), [w, T] = l(""), [E, D] = l(null), [O, k] = l(null), [A, j] = l(!1), [M, N] = l(!1), P = async (e) => {
18
+ }, b = u(), { setupMFA: x, enableMFA: S, disableMFA: C, isLoading: w } = r(), T = e((e) => e.user), E = e((e) => e.isAuthenticated), [D, O] = l(null), [k, A] = l(""), [j, M] = l(null), [N, P] = l(null), [F, I] = l(!1), [L, R] = l(!1), z = async (e) => {
16
19
  try {
17
- D(null), k(null), C(await g(e));
20
+ M(null), P(null), O(await x(e));
18
21
  } catch (e) {
19
- console.error("Failed to setup MFA:", e), D(e instanceof Error ? e.message : "Failed to setup MFA. Please try again.");
22
+ console.error("Failed to setup MFA:", e), M(e instanceof Error ? e.message : "Failed to setup MFA. Please try again.");
20
23
  }
21
24
  };
22
- return x ? /* @__PURE__ */ p("div", {
25
+ return E ? /* @__PURE__ */ m("div", {
23
26
  className: "max-w-2xl mx-auto p-6",
24
27
  children: [
25
- /* @__PURE__ */ f(a, {
26
- open: M,
27
- onOpenChange: N,
28
- title: h("auth.mfaSetup.disableTitle", "Disable two-factor authentication?"),
29
- description: h("auth.mfaSetup.disableDesc", "Your account will become less secure and future sign-ins will only require your password until MFA is re-enabled."),
30
- confirmText: h("auth.mfaSetup.disableConfirm", "Disable MFA"),
28
+ /* @__PURE__ */ p(a, {
29
+ open: L,
30
+ onOpenChange: R,
31
+ title: y("auth.mfaSetup.disableTitle", "Disable two-factor authentication?"),
32
+ description: y("auth.mfaSetup.disableDesc", "Your account will become less secure and future sign-ins will only require your password until MFA is re-enabled."),
33
+ confirmText: y("auth.mfaSetup.disableConfirm", "Disable MFA"),
31
34
  variant: "warning",
32
- isPending: y,
35
+ isPending: w,
33
36
  onConfirm: async () => {
34
37
  try {
35
- D(null), k(null), await v(), k(h("auth.mfaSetup.disableSuccess", "Two-factor authentication has been disabled.")), N(!1);
38
+ M(null), P(null), await C(), P(y("auth.mfaSetup.disableSuccess", "Two-factor authentication has been disabled.")), R(!1);
36
39
  } catch (e) {
37
- console.error("Failed to disable MFA:", e), D(e instanceof Error ? e.message : "Failed to disable MFA. Please try again.");
40
+ console.error("Failed to disable MFA:", e), M(e instanceof Error ? e.message : "Failed to disable MFA. Please try again.");
38
41
  }
39
42
  }
40
43
  }),
41
- /* @__PURE__ */ p("div", {
44
+ /* @__PURE__ */ m("div", {
42
45
  className: "mb-8",
43
- children: [/* @__PURE__ */ f("h1", {
44
- className: "text-3xl font-semibold text-[var(--color-text-primary)]",
45
- children: h("auth.mfaSetup.title", "Two-Factor Authentication")
46
- }), /* @__PURE__ */ f("p", {
47
- className: "text-[var(--color-text-secondary)] mt-2",
48
- children: h("auth.mfaSetup.subtitle", "Add an extra layer of security to your account")
49
- })]
46
+ children: [
47
+ /* @__PURE__ */ p("h1", {
48
+ className: "text-3xl font-semibold text-[var(--color-text-primary)]",
49
+ children: y("auth.mfaSetup.title", "Two-Factor Authentication")
50
+ }),
51
+ /* @__PURE__ */ p("p", {
52
+ className: "text-[var(--color-text-secondary)] mt-2",
53
+ children: y("auth.mfaSetup.subtitle", "Add an extra layer of security to your account")
54
+ }),
55
+ /* @__PURE__ */ p(_, {
56
+ className: "mt-3",
57
+ children: y("auth.mfaSetup.purpose", "Two-factor authentication (2FA) asks for a one-time code from an authenticator app at sign-in, so your account stays safe even if your password leaks. Set it up here and keep your backup codes somewhere safe.")
58
+ })
59
+ ]
50
60
  }),
51
- O && /* @__PURE__ */ f("div", {
61
+ N && /* @__PURE__ */ p("div", {
52
62
  className: "mb-6 p-4 rounded-xl bg-[var(--color-status-success-bg-subtle)] border border-[var(--color-status-success-border)]",
53
- children: /* @__PURE__ */ p("div", {
63
+ children: /* @__PURE__ */ m("div", {
54
64
  className: "flex items-center gap-3",
55
- children: [/* @__PURE__ */ f("svg", {
65
+ children: [/* @__PURE__ */ p("svg", {
56
66
  className: "size-5 text-[var(--color-status-success-text)]",
57
67
  fill: "none",
58
68
  viewBox: "0 0 24 24",
59
69
  stroke: "currentColor",
60
- children: /* @__PURE__ */ f("path", {
70
+ children: /* @__PURE__ */ p("path", {
61
71
  strokeLinecap: "round",
62
72
  strokeLinejoin: "round",
63
73
  strokeWidth: 2,
64
74
  d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"
65
75
  })
66
- }), /* @__PURE__ */ f("p", {
76
+ }), /* @__PURE__ */ p("p", {
67
77
  className: "text-[var(--color-status-success-text)]",
68
- children: O
78
+ children: N
69
79
  })]
70
80
  })
71
81
  }),
72
- E && /* @__PURE__ */ p("div", {
82
+ j && /* @__PURE__ */ m("div", {
73
83
  className: "mb-6 flex items-start gap-3 p-4 rounded-xl bg-[var(--color-status-error-bg-subtle)] border border-[var(--color-status-error-border)]",
74
- children: [/* @__PURE__ */ f(t, { className: "size-5 text-[var(--color-status-error-text)] flex-shrink-0 mt-0.5" }), /* @__PURE__ */ p("div", {
84
+ children: [/* @__PURE__ */ p(t, { className: "size-5 text-[var(--color-status-error-text)] flex-shrink-0 mt-0.5" }), /* @__PURE__ */ m("div", {
75
85
  className: "flex-1",
76
- children: [/* @__PURE__ */ f("p", {
86
+ children: [/* @__PURE__ */ p("p", {
77
87
  className: "text-sm text-[var(--color-status-error-text)]",
78
- children: E
79
- }), /* @__PURE__ */ f("button", {
88
+ children: j
89
+ }), /* @__PURE__ */ p("button", {
80
90
  type: "button",
81
- onClick: () => D(null),
91
+ onClick: () => M(null),
82
92
  className: "mt-2 text-sm text-[var(--color-status-error-text)] hover:underline transition-colors duration-200",
83
- children: h("auth.mfaSetup.dismiss", "Dismiss")
93
+ children: y("auth.mfaSetup.dismiss", "Dismiss")
84
94
  })]
85
95
  })]
86
96
  }),
87
- S ? /* @__PURE__ */ p("div", {
97
+ D ? /* @__PURE__ */ m("div", {
88
98
  className: "p-6 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] shadow-sm",
89
- children: [/* @__PURE__ */ p("div", {
99
+ children: [/* @__PURE__ */ m("div", {
90
100
  className: "flex items-center gap-3 mb-6",
91
- children: [/* @__PURE__ */ f("div", {
101
+ children: [/* @__PURE__ */ p("div", {
92
102
  className: "size-10 rounded-full bg-[var(--color-bg-accent)] flex items-center justify-center",
93
- children: /* @__PURE__ */ f("svg", {
103
+ children: /* @__PURE__ */ p("svg", {
94
104
  className: "size-5 text-[var(--color-text-link)]",
95
105
  fill: "none",
96
106
  viewBox: "0 0 24 24",
97
107
  stroke: "currentColor",
98
- children: /* @__PURE__ */ f("path", {
108
+ children: /* @__PURE__ */ p("path", {
99
109
  strokeLinecap: "round",
100
110
  strokeLinejoin: "round",
101
111
  strokeWidth: 2,
102
112
  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"
103
113
  })
104
114
  })
105
- }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h2", {
115
+ }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h2", {
106
116
  className: "text-xl font-semibold text-[var(--color-text-primary)]",
107
- children: h("auth.mfaSetup.setupAuthApp", "Setup Authenticator App")
108
- }), /* @__PURE__ */ f("p", {
117
+ children: y("auth.mfaSetup.setupAuthApp", "Setup Authenticator App")
118
+ }), /* @__PURE__ */ p("p", {
109
119
  className: "text-sm text-[var(--color-text-secondary)]",
110
- children: h("auth.mfaSetup.scanQr", "Scan the QR code with your authenticator app")
120
+ children: y("auth.mfaSetup.scanQr", "Scan the QR code with your authenticator app")
111
121
  })] })]
112
- }), /* @__PURE__ */ p("div", {
122
+ }), /* @__PURE__ */ m("div", {
113
123
  className: "space-y-6",
114
124
  children: [
115
- S.qrCode && /* @__PURE__ */ f("div", {
125
+ D.qrCode && /* @__PURE__ */ p("div", {
116
126
  className: "flex justify-center",
117
- children: /* @__PURE__ */ f("div", {
127
+ children: /* @__PURE__ */ p("div", {
118
128
  className: "p-4 bg-[var(--color-bg-surface)] rounded-xl border border-[var(--color-border-default)]",
119
- children: /* @__PURE__ */ f(i, {
120
- value: S.qrCode,
129
+ children: /* @__PURE__ */ p(i, {
130
+ value: D.qrCode,
121
131
  size: 192,
122
132
  level: "M",
123
133
  includeMargin: !1,
@@ -125,40 +135,40 @@ function m() {
125
135
  })
126
136
  })
127
137
  }),
128
- S.secret && /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
138
+ D.secret && /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
129
139
  className: "text-sm text-[var(--color-text-secondary)] mb-2",
130
- children: h("auth.mfaSetup.cantScan", "Can't scan the QR code? Enter this key manually:")
131
- }), /* @__PURE__ */ f("code", {
140
+ children: y("auth.mfaSetup.cantScan", "Can't scan the QR code? Enter this key manually:")
141
+ }), /* @__PURE__ */ p("code", {
132
142
  className: "block p-3 rounded-lg bg-[var(--color-bg-muted)] text-[var(--color-text-primary)] font-mono text-sm break-all select-all",
133
- children: S.secret
143
+ children: D.secret
134
144
  })] }),
135
- S.backupCodes && S.backupCodes.length > 0 && /* @__PURE__ */ p("div", {
145
+ D.backupCodes && D.backupCodes.length > 0 && /* @__PURE__ */ m("div", {
136
146
  className: "p-4 rounded-xl bg-[var(--color-status-warning-bg-subtle)] border border-[var(--color-status-warning-border)]",
137
147
  children: [
138
- /* @__PURE__ */ p("div", {
148
+ /* @__PURE__ */ m("div", {
139
149
  className: "flex items-start gap-3 mb-3",
140
- children: [/* @__PURE__ */ f("svg", {
150
+ children: [/* @__PURE__ */ p("svg", {
141
151
  className: "size-5 text-[var(--color-status-warning-text)] flex-shrink-0 mt-0.5",
142
152
  fill: "none",
143
153
  viewBox: "0 0 24 24",
144
154
  stroke: "currentColor",
145
- children: /* @__PURE__ */ f("path", {
155
+ children: /* @__PURE__ */ p("path", {
146
156
  strokeLinecap: "round",
147
157
  strokeLinejoin: "round",
148
158
  strokeWidth: 2,
149
159
  d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
150
160
  })
151
- }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h3", {
161
+ }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h3", {
152
162
  className: "font-medium text-[var(--color-status-warning-text)]",
153
- children: h("auth.mfaSetup.saveBackupCodes", "Save your backup codes")
154
- }), /* @__PURE__ */ f("p", {
163
+ children: y("auth.mfaSetup.saveBackupCodes", "Save your backup codes")
164
+ }), /* @__PURE__ */ p("p", {
155
165
  className: "text-sm text-[var(--color-status-warning-text)]",
156
- children: h("auth.mfaSetup.storeCodesSafely", "Store these codes safely. You can use them to access your account if you lose your authenticator device.")
166
+ children: y("auth.mfaSetup.storeCodesSafely", "Store these codes safely. You can use them to access your account if you lose your authenticator device.")
157
167
  })] })]
158
168
  }),
159
- /* @__PURE__ */ f("div", {
169
+ /* @__PURE__ */ p("div", {
160
170
  className: "p-3 rounded-lg bg-[var(--color-bg-surface)] grid grid-cols-2 gap-2 mb-3",
161
- children: S.backupCodes.map((e, t) => /* @__PURE__ */ p("code", {
171
+ children: D.backupCodes.map((e, t) => /* @__PURE__ */ m("code", {
162
172
  className: "text-sm text-[var(--color-text-primary)] font-mono",
163
173
  children: [
164
174
  t + 1,
@@ -167,185 +177,213 @@ function m() {
167
177
  ]
168
178
  }, e))
169
179
  }),
170
- /* @__PURE__ */ f("button", {
180
+ /* @__PURE__ */ p("button", {
171
181
  type: "button",
172
182
  onClick: async () => {
173
- S?.backupCodes && (s("light"), await o(S.backupCodes.join("\n")) ? (j(!0), c("success"), setTimeout(() => j(!1), 2e3)) : c("error"));
183
+ D?.backupCodes && (s("light"), await o(D.backupCodes.join("\n")) ? (I(!0), c("success"), setTimeout(() => I(!1), 2e3)) : c("error"));
174
184
  },
175
185
  className: "text-sm font-medium text-[var(--color-status-warning-text)] hover:underline transition-colors duration-200",
176
- children: A ? h("auth.mfaSetup.copied", "Copied!") : h("auth.mfaSetup.copyBackupCodes", "Copy backup codes")
186
+ children: F ? y("auth.mfaSetup.copied", "Copied!") : y("auth.mfaSetup.copyBackupCodes", "Copy backup codes")
177
187
  })
178
188
  ]
179
189
  }),
180
- /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
190
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
181
191
  htmlFor: "mfa-verification-code",
182
192
  className: "block text-sm font-medium text-[var(--color-text-primary)] mb-2",
183
- children: h("auth.mfaSetup.enterCode", "Enter the 6-digit code from your app")
184
- }), /* @__PURE__ */ f("input", {
193
+ children: y("auth.mfaSetup.enterCode", "Enter the 6-digit code from your app")
194
+ }), /* @__PURE__ */ p("input", {
185
195
  id: "mfa-verification-code",
186
196
  type: "text",
187
197
  inputMode: "numeric",
188
198
  maxLength: 6,
189
- value: w,
190
- onChange: (e) => T(e.target.value.replace(/\D/g, "")),
191
- placeholder: h("auth.mfa.verificationCodePlaceholder", "000000"),
192
- "aria-label": h("auth.mfaSetup.enterCode", "Enter the 6-digit code from your app"),
199
+ value: k,
200
+ onChange: (e) => A(e.target.value.replace(/\D/g, "")),
201
+ placeholder: y("auth.mfa.verificationCodePlaceholder", "000000"),
202
+ "aria-label": y("auth.mfaSetup.enterCode", "Enter the 6-digit code from your app"),
193
203
  "aria-required": "true",
194
204
  autoComplete: "one-time-code",
195
205
  className: "block w-full px-4 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] text-center text-2xl tracking-widest font-mono focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all duration-300"
196
206
  })] }),
197
- /* @__PURE__ */ p("div", {
207
+ /* @__PURE__ */ m("div", {
198
208
  className: "flex gap-3",
199
- children: [/* @__PURE__ */ f("button", {
209
+ children: [/* @__PURE__ */ p("button", {
200
210
  type: "button",
201
211
  onClick: () => {
202
- C(null), T(""), D(null);
212
+ O(null), A(""), M(null);
203
213
  },
204
214
  className: "flex-1 py-3 px-4 rounded-xl border border-[var(--color-border-default)] text-[var(--color-text-secondary)] font-medium hover:bg-[var(--color-bg-muted)] transition-colors duration-200",
205
- children: h("auth.mfaSetup.cancel", "Cancel")
206
- }), /* @__PURE__ */ f("button", {
215
+ children: y("auth.mfaSetup.cancel", "Cancel")
216
+ }), /* @__PURE__ */ p(h, {
207
217
  type: "button",
208
218
  onClick: async () => {
209
- if (w.length !== 6) {
210
- D(h("auth.mfaSetup.enter6Digit", "Please enter a 6-digit code"));
219
+ if (k.length !== 6) {
220
+ M(y("auth.mfaSetup.enter6Digit", "Please enter a 6-digit code"));
211
221
  return;
212
222
  }
213
223
  try {
214
- D(null), await _(w) && (C(null), T(""), k(h("auth.mfaSetup.enableSuccess", "Two-factor authentication has been enabled successfully!")));
224
+ M(null), await S(k) && (O(null), A(""), P(y("auth.mfaSetup.enableSuccess", "Two-factor authentication has been enabled successfully!")));
215
225
  } catch (e) {
216
- console.error("Failed to verify MFA code:", e), D(e instanceof Error ? e.message : "Invalid verification code. Please try again.");
226
+ console.error("Failed to verify MFA code:", e), M(e instanceof Error ? e.message : "Invalid verification code. Please try again.");
217
227
  }
218
228
  },
219
- disabled: y || w.length !== 6,
220
- className: "auth-primary-button flex flex-1 items-center justify-center gap-2 px-4 py-3 font-medium",
221
- children: y ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(n, { className: "size-5 animate-spin" }), /* @__PURE__ */ f("span", { children: h("auth.mfa.verifying", "Verifying...") })] }) : h("auth.mfaSetup.enable2fa", "Enable 2FA")
229
+ disabled: w || k.length !== 6,
230
+ variant: "default",
231
+ size: "lg",
232
+ className: "flex-1 font-semibold",
233
+ children: w ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(n, { className: "size-5 animate-spin" }), /* @__PURE__ */ p("span", { children: y("auth.mfa.verifying", "Verifying...") })] }) : y("auth.mfaSetup.enable2fa", "Enable 2FA")
222
234
  })]
223
235
  })
224
236
  ]
225
237
  })]
226
- }) : /* @__PURE__ */ f("div", {
238
+ }) : /* @__PURE__ */ p("div", {
227
239
  className: "p-6 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] shadow-sm",
228
- children: b?.mfaEnabled ? /* @__PURE__ */ p(d, { children: [
229
- /* @__PURE__ */ p("div", {
240
+ children: T?.mfaEnabled ? /* @__PURE__ */ m(f, { children: [
241
+ /* @__PURE__ */ m("div", {
230
242
  className: "flex items-center gap-4 mb-6",
231
- children: [/* @__PURE__ */ f("div", {
243
+ children: [/* @__PURE__ */ p("div", {
232
244
  className: "size-12 rounded-full bg-[var(--color-status-success-bg-subtle)] flex items-center justify-center",
233
- children: /* @__PURE__ */ f("svg", {
245
+ children: /* @__PURE__ */ p("svg", {
234
246
  className: "size-6 text-[var(--color-status-success-text)]",
235
247
  fill: "none",
236
248
  viewBox: "0 0 24 24",
237
249
  stroke: "currentColor",
238
- children: /* @__PURE__ */ f("path", {
250
+ children: /* @__PURE__ */ p("path", {
239
251
  strokeLinecap: "round",
240
252
  strokeLinejoin: "round",
241
253
  strokeWidth: 2,
242
254
  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"
243
255
  })
244
256
  })
245
- }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h2", {
257
+ }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h2", {
246
258
  className: "text-xl font-semibold text-[var(--color-text-primary)]",
247
- children: h("auth.mfaSetup.twoFactorOn", "Two-Factor Authentication is On")
248
- }), /* @__PURE__ */ f("p", {
259
+ children: y("auth.mfaSetup.twoFactorOn", "Two-Factor Authentication is On")
260
+ }), /* @__PURE__ */ p("p", {
249
261
  className: "text-[var(--color-text-secondary)]",
250
- children: h("auth.mfaSetup.protected", "Your account is protected with an authenticator app")
262
+ children: y("auth.mfaSetup.protected", "Your account is protected with an authenticator app")
251
263
  })] })]
252
264
  }),
253
- /* @__PURE__ */ f("div", {
265
+ /* @__PURE__ */ p("div", {
254
266
  className: "mb-6 p-4 rounded-lg bg-[var(--color-status-success-bg-subtle)] border border-[var(--color-status-success-border)]",
255
- children: /* @__PURE__ */ f("p", {
267
+ children: /* @__PURE__ */ p("p", {
256
268
  className: "text-sm text-[var(--color-status-success-text)]",
257
- children: h("auth.mfaSetup.verificationOnSignIn", "You'll be asked for a verification code from your authenticator app when signing in.")
269
+ children: y("auth.mfaSetup.verificationOnSignIn", "You'll be asked for a verification code from your authenticator app when signing in.")
258
270
  })
259
271
  }),
260
- /* @__PURE__ */ f("button", {
272
+ /* @__PURE__ */ p("button", {
261
273
  type: "button",
262
- onClick: () => N(!0),
263
- disabled: y,
274
+ onClick: () => R(!0),
275
+ disabled: w,
264
276
  className: "w-full py-3 px-4 rounded-xl border border-[var(--color-status-error-border)] text-[var(--color-status-error-text)] font-medium bg-[var(--color-bg-surface)] hover:bg-[var(--color-status-error-bg-subtle)] disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200 flex items-center justify-center gap-2",
265
- children: y ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(n, { className: "size-5 animate-spin" }), /* @__PURE__ */ f("span", { children: h("auth.mfa.disabling", "Disabling...") })] }) : h("auth.mfaSetup.disableTwoFactor", "Disable Two-Factor Authentication")
277
+ children: w ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(n, { className: "size-5 animate-spin" }), /* @__PURE__ */ p("span", { children: y("auth.mfa.disabling", "Disabling...") })] }) : y("auth.mfaSetup.disableTwoFactor", "Disable Two-Factor Authentication")
278
+ }),
279
+ /* @__PURE__ */ p(g, {
280
+ className: "mt-6",
281
+ storageKey: "auth-mfa-enabled",
282
+ steps: [
283
+ {
284
+ id: "review-sessions",
285
+ label: y("auth.mfaSetup.nextReviewSessions", "Review your active sessions"),
286
+ description: y("auth.mfaSetup.nextReviewSessionsDesc", "Sign out any device you no longer recognise."),
287
+ onClick: () => b("/auth/sessions")
288
+ },
289
+ {
290
+ id: "security-center",
291
+ label: y("auth.mfaSetup.nextSecurityCenter", "Visit the Security Center"),
292
+ description: y("auth.mfaSetup.nextSecurityCenterDesc", "Check your password and account protection at a glance."),
293
+ onClick: () => b("/auth/security")
294
+ },
295
+ {
296
+ id: "update-profile",
297
+ label: y("auth.mfaSetup.nextProfile", "Keep your profile up to date"),
298
+ description: y("auth.mfaSetup.nextProfileDesc", "Confirm your recovery email and contact details."),
299
+ onClick: () => b("/auth/profile")
300
+ }
301
+ ]
266
302
  })
267
- ] }) : /* @__PURE__ */ p(d, { children: [
268
- /* @__PURE__ */ p("div", {
303
+ ] }) : /* @__PURE__ */ m(f, { children: [
304
+ /* @__PURE__ */ m("div", {
269
305
  className: "flex items-center gap-4 mb-6",
270
- children: [/* @__PURE__ */ f("div", {
306
+ children: [/* @__PURE__ */ p("div", {
271
307
  className: "size-12 rounded-full bg-[var(--color-bg-muted)] flex items-center justify-center",
272
- children: /* @__PURE__ */ f("svg", {
308
+ children: /* @__PURE__ */ p("svg", {
273
309
  className: "size-6 text-[var(--color-text-tertiary)]",
274
310
  fill: "none",
275
311
  viewBox: "0 0 24 24",
276
312
  stroke: "currentColor",
277
- children: /* @__PURE__ */ f("path", {
313
+ children: /* @__PURE__ */ p("path", {
278
314
  strokeLinecap: "round",
279
315
  strokeLinejoin: "round",
280
316
  strokeWidth: 2,
281
317
  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"
282
318
  })
283
319
  })
284
- }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h2", {
320
+ }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h2", {
285
321
  className: "text-xl font-semibold text-[var(--color-text-primary)]",
286
- children: h("auth.mfaSetup.twoFactorOff", "Two-Factor Authentication is Off")
287
- }), /* @__PURE__ */ f("p", {
322
+ children: y("auth.mfaSetup.twoFactorOff", "Two-Factor Authentication is Off")
323
+ }), /* @__PURE__ */ p("p", {
288
324
  className: "text-[var(--color-text-secondary)]",
289
- children: h("auth.mfaSetup.notProtected", "Your account is not protected with 2FA")
325
+ children: y("auth.mfaSetup.notProtected", "Your account is not protected with 2FA")
290
326
  })] })]
291
327
  }),
292
- /* @__PURE__ */ p("div", {
328
+ /* @__PURE__ */ m("div", {
293
329
  className: "mb-6 p-4 rounded-lg bg-[var(--color-bg-accent)] border border-[var(--color-border-default)]",
294
- children: [/* @__PURE__ */ f("h3", {
330
+ children: [/* @__PURE__ */ p("h3", {
295
331
  className: "font-medium text-[var(--color-text-link)] mb-2",
296
- children: h("auth.mfaSetup.whyEnable", "Why enable 2FA?")
297
- }), /* @__PURE__ */ p("ul", {
332
+ children: y("auth.mfaSetup.whyEnable", "Why enable 2FA?")
333
+ }), /* @__PURE__ */ m("ul", {
298
334
  className: "text-sm text-[var(--color-text-link)] space-y-1",
299
335
  children: [
300
- /* @__PURE__ */ f("li", { children: "• Protects your account even if your password is compromised" }),
301
- /* @__PURE__ */ f("li", { children: "• Adds a second verification step during sign-in" }),
302
- /* @__PURE__ */ f("li", { children: "• Works with popular authenticator apps (Google, Authy, etc.)" })
336
+ /* @__PURE__ */ p("li", { children: "• Protects your account even if your password is compromised" }),
337
+ /* @__PURE__ */ p("li", { children: "• Adds a second verification step during sign-in" }),
338
+ /* @__PURE__ */ p("li", { children: "• Works with popular authenticator apps (Google, Authy, etc.)" })
303
339
  ]
304
340
  })]
305
341
  }),
306
- /* @__PURE__ */ f("button", {
342
+ /* @__PURE__ */ p(h, {
307
343
  type: "button",
308
- onClick: () => P("TOTP"),
309
- disabled: y,
310
- className: "auth-primary-button flex w-full items-center justify-center gap-2 px-4 py-3 font-medium",
311
- children: y ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(n, { className: "size-5 animate-spin" }), /* @__PURE__ */ f("span", { children: h("auth.mfa.settingUp", "Setting up...") })] }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("svg", {
344
+ onClick: () => z("TOTP"),
345
+ disabled: w,
346
+ variant: "default",
347
+ size: "lg",
348
+ className: "w-full font-semibold",
349
+ children: w ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(n, { className: "size-5 animate-spin" }), /* @__PURE__ */ p("span", { children: y("auth.mfa.settingUp", "Setting up...") })] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("svg", {
312
350
  className: "size-5",
313
351
  fill: "none",
314
352
  viewBox: "0 0 24 24",
315
353
  stroke: "currentColor",
316
- children: /* @__PURE__ */ f("path", {
354
+ children: /* @__PURE__ */ p("path", {
317
355
  strokeLinecap: "round",
318
356
  strokeLinejoin: "round",
319
357
  strokeWidth: 2,
320
358
  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"
321
359
  })
322
- }), /* @__PURE__ */ f("span", { children: h("auth.mfaSetup.enableTwoFactor", "Enable Two-Factor Authentication") })] })
360
+ }), /* @__PURE__ */ p("span", { children: y("auth.mfaSetup.enableTwoFactor", "Enable Two-Factor Authentication") })] })
323
361
  })
324
362
  ] })
325
363
  })
326
364
  ]
327
- }) : /* @__PURE__ */ f("div", {
365
+ }) : /* @__PURE__ */ p("div", {
328
366
  className: "max-w-2xl mx-auto p-6",
329
- children: /* @__PURE__ */ p("div", {
367
+ children: /* @__PURE__ */ m("div", {
330
368
  className: "text-center py-16 border-2 border-dashed border-border-default rounded-xl",
331
369
  children: [
332
- /* @__PURE__ */ f("div", {
370
+ /* @__PURE__ */ p("div", {
333
371
  className: "size-16 mx-auto mb-4 rounded-full bg-status-warning-bg-subtle flex items-center justify-center",
334
- children: /* @__PURE__ */ f(t, { className: "size-8 text-status-warning-text" })
372
+ children: /* @__PURE__ */ p(t, { className: "size-8 text-status-warning-text" })
335
373
  }),
336
- /* @__PURE__ */ f("h2", {
374
+ /* @__PURE__ */ p("h2", {
337
375
  className: "text-xl font-semibold text-text-primary mb-2",
338
- children: h("auth.mfaSetup.authRequired", "Authentication Required")
376
+ children: y("auth.mfaSetup.authRequired", "Authentication Required")
339
377
  }),
340
- /* @__PURE__ */ f("p", {
378
+ /* @__PURE__ */ p("p", {
341
379
  className: "text-text-secondary",
342
- children: h("auth.mfaSetup.signInToManage", "Please sign in to manage MFA settings")
380
+ children: y("auth.mfaSetup.signInToManage", "Please sign in to manage MFA settings")
343
381
  })
344
382
  ]
345
383
  })
346
384
  });
347
385
  }
348
386
  //#endregion
349
- export { m as MfaSetupPage };
387
+ export { v as MfaSetupPage };
350
388
 
351
389
  //# sourceMappingURL=MfaSetupPage.js.map