@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
|
@@ -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 {
|
|
9
|
-
import {
|
|
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
|
|
12
|
-
let { t:
|
|
13
|
-
let n =
|
|
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:
|
|
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
|
-
|
|
20
|
+
M(null), P(null), O(await x(e));
|
|
18
21
|
} catch (e) {
|
|
19
|
-
console.error("Failed to setup MFA:", e),
|
|
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
|
|
25
|
+
return E ? /* @__PURE__ */ m("div", {
|
|
23
26
|
className: "max-w-2xl mx-auto p-6",
|
|
24
27
|
children: [
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
open:
|
|
27
|
-
onOpenChange:
|
|
28
|
-
title:
|
|
29
|
-
description:
|
|
30
|
-
confirmText:
|
|
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:
|
|
35
|
+
isPending: w,
|
|
33
36
|
onConfirm: async () => {
|
|
34
37
|
try {
|
|
35
|
-
|
|
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),
|
|
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__ */
|
|
44
|
+
/* @__PURE__ */ m("div", {
|
|
42
45
|
className: "mb-8",
|
|
43
|
-
children: [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
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__ */
|
|
63
|
+
children: /* @__PURE__ */ m("div", {
|
|
54
64
|
className: "flex items-center gap-3",
|
|
55
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
76
|
+
}), /* @__PURE__ */ p("p", {
|
|
67
77
|
className: "text-[var(--color-status-success-text)]",
|
|
68
|
-
children:
|
|
78
|
+
children: N
|
|
69
79
|
})]
|
|
70
80
|
})
|
|
71
81
|
}),
|
|
72
|
-
|
|
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__ */
|
|
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__ */
|
|
86
|
+
children: [/* @__PURE__ */ p("p", {
|
|
77
87
|
className: "text-sm text-[var(--color-status-error-text)]",
|
|
78
|
-
children:
|
|
79
|
-
}), /* @__PURE__ */
|
|
88
|
+
children: j
|
|
89
|
+
}), /* @__PURE__ */ p("button", {
|
|
80
90
|
type: "button",
|
|
81
|
-
onClick: () =>
|
|
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:
|
|
93
|
+
children: y("auth.mfaSetup.dismiss", "Dismiss")
|
|
84
94
|
})]
|
|
85
95
|
})]
|
|
86
96
|
}),
|
|
87
|
-
|
|
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__ */
|
|
99
|
+
children: [/* @__PURE__ */ m("div", {
|
|
90
100
|
className: "flex items-center gap-3 mb-6",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
115
|
+
}), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h2", {
|
|
106
116
|
className: "text-xl font-semibold text-[var(--color-text-primary)]",
|
|
107
|
-
children:
|
|
108
|
-
}), /* @__PURE__ */
|
|
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:
|
|
120
|
+
children: y("auth.mfaSetup.scanQr", "Scan the QR code with your authenticator app")
|
|
111
121
|
})] })]
|
|
112
|
-
}), /* @__PURE__ */
|
|
122
|
+
}), /* @__PURE__ */ m("div", {
|
|
113
123
|
className: "space-y-6",
|
|
114
124
|
children: [
|
|
115
|
-
|
|
125
|
+
D.qrCode && /* @__PURE__ */ p("div", {
|
|
116
126
|
className: "flex justify-center",
|
|
117
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
120
|
-
value:
|
|
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
|
-
|
|
138
|
+
D.secret && /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
|
|
129
139
|
className: "text-sm text-[var(--color-text-secondary)] mb-2",
|
|
130
|
-
children:
|
|
131
|
-
}), /* @__PURE__ */
|
|
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:
|
|
143
|
+
children: D.secret
|
|
134
144
|
})] }),
|
|
135
|
-
|
|
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__ */
|
|
148
|
+
/* @__PURE__ */ m("div", {
|
|
139
149
|
className: "flex items-start gap-3 mb-3",
|
|
140
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
161
|
+
}), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h3", {
|
|
152
162
|
className: "font-medium text-[var(--color-status-warning-text)]",
|
|
153
|
-
children:
|
|
154
|
-
}), /* @__PURE__ */
|
|
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:
|
|
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__ */
|
|
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:
|
|
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__ */
|
|
180
|
+
/* @__PURE__ */ p("button", {
|
|
171
181
|
type: "button",
|
|
172
182
|
onClick: async () => {
|
|
173
|
-
|
|
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:
|
|
186
|
+
children: F ? y("auth.mfaSetup.copied", "Copied!") : y("auth.mfaSetup.copyBackupCodes", "Copy backup codes")
|
|
177
187
|
})
|
|
178
188
|
]
|
|
179
189
|
}),
|
|
180
|
-
/* @__PURE__ */
|
|
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:
|
|
184
|
-
}), /* @__PURE__ */
|
|
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:
|
|
190
|
-
onChange: (e) =>
|
|
191
|
-
placeholder:
|
|
192
|
-
"aria-label":
|
|
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__ */
|
|
207
|
+
/* @__PURE__ */ m("div", {
|
|
198
208
|
className: "flex gap-3",
|
|
199
|
-
children: [/* @__PURE__ */
|
|
209
|
+
children: [/* @__PURE__ */ p("button", {
|
|
200
210
|
type: "button",
|
|
201
211
|
onClick: () => {
|
|
202
|
-
|
|
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:
|
|
206
|
-
}), /* @__PURE__ */
|
|
215
|
+
children: y("auth.mfaSetup.cancel", "Cancel")
|
|
216
|
+
}), /* @__PURE__ */ p(h, {
|
|
207
217
|
type: "button",
|
|
208
218
|
onClick: async () => {
|
|
209
|
-
if (
|
|
210
|
-
|
|
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
|
-
|
|
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),
|
|
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:
|
|
220
|
-
|
|
221
|
-
|
|
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__ */
|
|
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:
|
|
229
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
257
|
+
}), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h2", {
|
|
246
258
|
className: "text-xl font-semibold text-[var(--color-text-primary)]",
|
|
247
|
-
children:
|
|
248
|
-
}), /* @__PURE__ */
|
|
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:
|
|
262
|
+
children: y("auth.mfaSetup.protected", "Your account is protected with an authenticator app")
|
|
251
263
|
})] })]
|
|
252
264
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
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__ */
|
|
267
|
+
children: /* @__PURE__ */ p("p", {
|
|
256
268
|
className: "text-sm text-[var(--color-status-success-text)]",
|
|
257
|
-
children:
|
|
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__ */
|
|
272
|
+
/* @__PURE__ */ p("button", {
|
|
261
273
|
type: "button",
|
|
262
|
-
onClick: () =>
|
|
263
|
-
disabled:
|
|
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:
|
|
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__ */
|
|
268
|
-
/* @__PURE__ */
|
|
303
|
+
] }) : /* @__PURE__ */ m(f, { children: [
|
|
304
|
+
/* @__PURE__ */ m("div", {
|
|
269
305
|
className: "flex items-center gap-4 mb-6",
|
|
270
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
320
|
+
}), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h2", {
|
|
285
321
|
className: "text-xl font-semibold text-[var(--color-text-primary)]",
|
|
286
|
-
children:
|
|
287
|
-
}), /* @__PURE__ */
|
|
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:
|
|
325
|
+
children: y("auth.mfaSetup.notProtected", "Your account is not protected with 2FA")
|
|
290
326
|
})] })]
|
|
291
327
|
}),
|
|
292
|
-
/* @__PURE__ */
|
|
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__ */
|
|
330
|
+
children: [/* @__PURE__ */ p("h3", {
|
|
295
331
|
className: "font-medium text-[var(--color-text-link)] mb-2",
|
|
296
|
-
children:
|
|
297
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
301
|
-
/* @__PURE__ */
|
|
302
|
-
/* @__PURE__ */
|
|
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__ */
|
|
342
|
+
/* @__PURE__ */ p(h, {
|
|
307
343
|
type: "button",
|
|
308
|
-
onClick: () =>
|
|
309
|
-
disabled:
|
|
310
|
-
|
|
311
|
-
|
|
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__ */
|
|
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__ */
|
|
360
|
+
}), /* @__PURE__ */ p("span", { children: y("auth.mfaSetup.enableTwoFactor", "Enable Two-Factor Authentication") })] })
|
|
323
361
|
})
|
|
324
362
|
] })
|
|
325
363
|
})
|
|
326
364
|
]
|
|
327
|
-
}) : /* @__PURE__ */
|
|
365
|
+
}) : /* @__PURE__ */ p("div", {
|
|
328
366
|
className: "max-w-2xl mx-auto p-6",
|
|
329
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
372
|
+
children: /* @__PURE__ */ p(t, { className: "size-8 text-status-warning-text" })
|
|
335
373
|
}),
|
|
336
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__PURE__ */ p("h2", {
|
|
337
375
|
className: "text-xl font-semibold text-text-primary mb-2",
|
|
338
|
-
children:
|
|
376
|
+
children: y("auth.mfaSetup.authRequired", "Authentication Required")
|
|
339
377
|
}),
|
|
340
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ p("p", {
|
|
341
379
|
className: "text-text-secondary",
|
|
342
|
-
children:
|
|
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 {
|
|
387
|
+
export { v as MfaSetupPage };
|
|
350
388
|
|
|
351
389
|
//# sourceMappingURL=MfaSetupPage.js.map
|