@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
|
@@ -6,72 +6,74 @@ import { useEffect as u, useState as d } from "react";
|
|
|
6
6
|
import { useNavigate as f, useSearchParams as p } from "react-router-dom";
|
|
7
7
|
import { useI18n as m } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
8
8
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
9
|
+
import { Button as v } from "@burdenoff/fe-libs/button";
|
|
10
|
+
import { PagePurpose as y } from "@burdenoff/fe-libs/ui";
|
|
9
11
|
//#region src/auth/pages/PasswordResetPage.tsx
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
let
|
|
13
|
-
let n =
|
|
12
|
+
var b = 5;
|
|
13
|
+
function x() {
|
|
14
|
+
let x = f(), { t: S } = m(), C = (e, t) => {
|
|
15
|
+
let n = S(e);
|
|
14
16
|
return n === e ? t : n;
|
|
15
|
-
}, [
|
|
17
|
+
}, [w] = p(), T = w.get("token"), E = w.get("returnTo"), { requestPasswordReset: D, resetPassword: O, isLoading: k } = l(), { executeRecaptcha: A } = c(), [j, M] = d(""), [N, P] = d(""), [F, I] = d(""), [L, R] = d(!1), [z, B] = d(!1), [V, H] = d(!1), [U, W] = d(""), [G, K] = d(b);
|
|
16
18
|
u(() => {
|
|
17
|
-
if (!
|
|
18
|
-
let e =
|
|
19
|
-
|
|
19
|
+
if (!V || !T) return;
|
|
20
|
+
let e = E ? `/auth/login?returnTo=${encodeURIComponent(E)}` : "/auth/login", t = setInterval(() => {
|
|
21
|
+
K((n) => n <= 1 ? (clearInterval(t), x(e), 0) : n - 1);
|
|
20
22
|
}, 1e3);
|
|
21
23
|
return () => clearInterval(t);
|
|
22
24
|
}, [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
V,
|
|
26
|
+
T,
|
|
27
|
+
x,
|
|
28
|
+
E
|
|
27
29
|
]);
|
|
28
|
-
let
|
|
29
|
-
let e =
|
|
30
|
+
let q = (() => {
|
|
31
|
+
let e = N;
|
|
30
32
|
return [
|
|
31
33
|
{
|
|
32
|
-
label:
|
|
34
|
+
label: C("auth.passwordReset.pwMin8", "At least 12 characters"),
|
|
33
35
|
met: e.length >= 12
|
|
34
36
|
},
|
|
35
37
|
{
|
|
36
|
-
label:
|
|
38
|
+
label: C("auth.passwordReset.pwUppercase", "One uppercase letter"),
|
|
37
39
|
met: /[A-Z]/.test(e)
|
|
38
40
|
},
|
|
39
41
|
{
|
|
40
|
-
label:
|
|
42
|
+
label: C("auth.passwordReset.pwLowercase", "One lowercase letter"),
|
|
41
43
|
met: /[a-z]/.test(e)
|
|
42
44
|
},
|
|
43
45
|
{
|
|
44
|
-
label:
|
|
46
|
+
label: C("auth.passwordReset.pwNumber", "One number"),
|
|
45
47
|
met: /\d/.test(e)
|
|
46
48
|
},
|
|
47
49
|
{
|
|
48
|
-
label:
|
|
50
|
+
label: C("auth.passwordReset.pwSpecial", "One special character"),
|
|
49
51
|
met: /[!@#$%^&*(),.?":{}|<>]/.test(e)
|
|
50
52
|
}
|
|
51
53
|
];
|
|
52
|
-
})(),
|
|
53
|
-
let e =
|
|
54
|
+
})(), J = (() => {
|
|
55
|
+
let e = q.filter((e) => e.met).length;
|
|
54
56
|
return e <= 2 ? {
|
|
55
|
-
level:
|
|
57
|
+
level: C("auth.passwordReset.passwordStrengthWeak", "weak"),
|
|
56
58
|
color: "bg-status-error-bg-subtle0",
|
|
57
59
|
width: "w-1/4"
|
|
58
60
|
} : e <= 3 ? {
|
|
59
|
-
level:
|
|
61
|
+
level: C("auth.passwordReset.passwordStrengthFair", "fair"),
|
|
60
62
|
color: "bg-status-warning-text",
|
|
61
63
|
width: "w-2/4"
|
|
62
64
|
} : e <= 4 ? {
|
|
63
|
-
level:
|
|
65
|
+
level: C("auth.passwordReset.passwordStrengthGood", "good"),
|
|
64
66
|
color: "bg-status-warning-bg-subtle0",
|
|
65
67
|
width: "w-3/4"
|
|
66
68
|
} : {
|
|
67
|
-
level:
|
|
69
|
+
level: C("auth.passwordReset.passwordStrengthStrong", "strong"),
|
|
68
70
|
color: "bg-status-success-bg-subtle0",
|
|
69
71
|
width: "w-full"
|
|
70
72
|
};
|
|
71
73
|
})();
|
|
72
|
-
return
|
|
73
|
-
title:
|
|
74
|
-
subtitle:
|
|
74
|
+
return V ? /* @__PURE__ */ _(e, {
|
|
75
|
+
title: T ? C("auth.passwordReset.passwordUpdated", "Password updated") : C("auth.passwordReset.checkEmail", "Check your email"),
|
|
76
|
+
subtitle: T ? C("auth.passwordReset.successSubtitle", "Your password has been successfully reset") : C("auth.passwordReset.sentInstructions", "We sent you instructions to reset your password"),
|
|
75
77
|
children: [
|
|
76
78
|
/* @__PURE__ */ g("div", {
|
|
77
79
|
className: "flex justify-center mb-6",
|
|
@@ -93,275 +95,288 @@ function y() {
|
|
|
93
95
|
}),
|
|
94
96
|
/* @__PURE__ */ g("p", {
|
|
95
97
|
className: "text-center text-[var(--color-text-secondary)] mb-8",
|
|
96
|
-
children:
|
|
98
|
+
children: T ? C("auth.passwordReset.canNowSignIn", "You can now use your new password to sign in to your account.") : C("auth.passwordReset.emailSentTo", "We sent an email to {{email}}. Click the link in the email to reset your password.").replace("{{email}}", j)
|
|
97
99
|
}),
|
|
98
|
-
|
|
100
|
+
T ? /* @__PURE__ */ _("div", {
|
|
99
101
|
className: "space-y-4",
|
|
100
102
|
children: [/* @__PURE__ */ _("p", {
|
|
101
103
|
className: "text-center text-sm text-[var(--color-text-tertiary)]",
|
|
102
104
|
children: [
|
|
103
|
-
|
|
105
|
+
C("auth.passwordReset.redirectingIn", "Redirecting to sign in in"),
|
|
104
106
|
" ",
|
|
105
107
|
/* @__PURE__ */ g("span", {
|
|
106
108
|
className: "font-semibold text-[var(--color-text-primary)]",
|
|
107
|
-
children:
|
|
109
|
+
children: G
|
|
108
110
|
}),
|
|
109
111
|
" ",
|
|
110
|
-
|
|
112
|
+
C("auth.passwordReset.seconds", "seconds...")
|
|
111
113
|
]
|
|
112
|
-
}), /* @__PURE__ */ g(
|
|
114
|
+
}), /* @__PURE__ */ g(v, {
|
|
113
115
|
type: "button",
|
|
114
|
-
onClick: () =>
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
onClick: () => x(E ? `/auth/login?returnTo=${encodeURIComponent(E)}` : "/auth/login"),
|
|
117
|
+
variant: "default",
|
|
118
|
+
size: "lg",
|
|
119
|
+
className: "w-full font-semibold",
|
|
120
|
+
children: C("auth.passwordReset.signInNow", "Sign in now")
|
|
117
121
|
})]
|
|
118
122
|
}) : /* @__PURE__ */ _("div", {
|
|
119
123
|
className: "space-y-4",
|
|
120
124
|
children: [/* @__PURE__ */ g("button", {
|
|
121
125
|
type: "button",
|
|
122
|
-
onClick: () =>
|
|
126
|
+
onClick: () => H(!1),
|
|
123
127
|
className: "w-full py-3 px-4 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] font-medium hover:bg-[var(--color-bg-sunken)] transition-all",
|
|
124
|
-
children:
|
|
128
|
+
children: C("auth.passwordReset.didntReceive", "Didn't receive the email? Try again")
|
|
125
129
|
}), /* @__PURE__ */ g("button", {
|
|
126
130
|
type: "button",
|
|
127
|
-
onClick: () =>
|
|
131
|
+
onClick: () => x("/auth/login"),
|
|
128
132
|
className: "w-full py-3 px-4 rounded-xl text-[var(--color-text-secondary)] font-medium hover:text-[var(--color-text-primary)] transition-colors",
|
|
129
|
-
children:
|
|
133
|
+
children: C("auth.passwordReset.backToSignIn", "Back to sign in")
|
|
130
134
|
})]
|
|
131
135
|
})
|
|
132
136
|
]
|
|
133
137
|
}) : /* @__PURE__ */ _(e, {
|
|
134
|
-
title:
|
|
135
|
-
subtitle:
|
|
136
|
-
children: [
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
138
|
+
title: T ? C("auth.passwordReset.createNewPassword", "Create new password") : C("auth.passwordReset.resetTitle", "Reset your password"),
|
|
139
|
+
subtitle: T ? C("auth.passwordReset.enterNewPassword", "Enter a new password for your account") : C("auth.passwordReset.enterEmail", "Enter your email and we'll send you a reset link"),
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ g(y, {
|
|
142
|
+
className: "mb-5",
|
|
143
|
+
children: T ? C("auth.passwordReset.purposeReset", "Choose a new password for your account. Make it strong and unique — you'll use it to sign in next time.") : C("auth.passwordReset.purposeRequest", "Forgot your password? Enter your email and we'll send a secure link to reset it. The link expires shortly for your safety.")
|
|
144
|
+
}),
|
|
145
|
+
T ? /* @__PURE__ */ _("form", {
|
|
146
|
+
onSubmit: async (e) => {
|
|
147
|
+
if (e.preventDefault(), W(""), T) {
|
|
148
|
+
if (N !== F) {
|
|
149
|
+
W(C("auth.passwordReset.passwordsNoMatch", "Passwords do not match"));
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
try {
|
|
153
|
+
await O(T, N), H(!0);
|
|
154
|
+
} catch (e) {
|
|
155
|
+
let t = e instanceof Error ? e.message : "";
|
|
156
|
+
W(t === "TOKEN_EXPIRED" ? C("auth.passwordReset.errorTokenExpired", "This password reset link has expired. Please request a new one.") : t === "INVALID_TOKEN" ? C("auth.passwordReset.errorInvalidToken", "This password reset link is invalid or has already been used.") : C("auth.passwordReset.errorGeneric", "Failed to reset password. Please try again."));
|
|
157
|
+
}
|
|
142
158
|
}
|
|
159
|
+
},
|
|
160
|
+
className: "space-y-5",
|
|
161
|
+
children: [
|
|
162
|
+
U && /* @__PURE__ */ _("div", {
|
|
163
|
+
className: "flex items-start gap-3 p-4 rounded-xl bg-[var(--color-status-error-bg-subtle)] border border-[var(--color-status-error-border)]",
|
|
164
|
+
children: [/* @__PURE__ */ g("svg", {
|
|
165
|
+
className: "size-5 text-[var(--color-status-error-text)] flex-shrink-0 mt-0.5",
|
|
166
|
+
fill: "none",
|
|
167
|
+
viewBox: "0 0 24 24",
|
|
168
|
+
stroke: "currentColor",
|
|
169
|
+
children: /* @__PURE__ */ g("path", {
|
|
170
|
+
strokeLinecap: "round",
|
|
171
|
+
strokeLinejoin: "round",
|
|
172
|
+
strokeWidth: 2,
|
|
173
|
+
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"
|
|
174
|
+
})
|
|
175
|
+
}), /* @__PURE__ */ g("p", {
|
|
176
|
+
className: "text-sm text-[var(--color-status-error-text)]",
|
|
177
|
+
children: U
|
|
178
|
+
})]
|
|
179
|
+
}),
|
|
180
|
+
/* @__PURE__ */ _("div", {
|
|
181
|
+
className: "space-y-2",
|
|
182
|
+
children: [
|
|
183
|
+
/* @__PURE__ */ g("label", {
|
|
184
|
+
htmlFor: "newPassword",
|
|
185
|
+
className: "block text-sm font-medium text-[var(--color-text-primary)]",
|
|
186
|
+
children: C("auth.passwordReset.newPasswordLabel", "New Password")
|
|
187
|
+
}),
|
|
188
|
+
/* @__PURE__ */ _("div", {
|
|
189
|
+
className: "relative",
|
|
190
|
+
children: [
|
|
191
|
+
/* @__PURE__ */ g("div", {
|
|
192
|
+
className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
|
|
193
|
+
children: /* @__PURE__ */ g(a, { className: "size-5 text-[var(--color-text-tertiary)]" })
|
|
194
|
+
}),
|
|
195
|
+
/* @__PURE__ */ g("input", {
|
|
196
|
+
id: "newPassword",
|
|
197
|
+
type: L ? "text" : "password",
|
|
198
|
+
required: !0,
|
|
199
|
+
"aria-required": "true",
|
|
200
|
+
"aria-label": C("auth.passwordReset.newPasswordLabel", "New Password"),
|
|
201
|
+
autoComplete: "new-password",
|
|
202
|
+
value: N,
|
|
203
|
+
onChange: (e) => P(e.target.value),
|
|
204
|
+
className: "block w-full pl-[3.5rem] pr-12 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
|
|
205
|
+
placeholder: C("auth.passwordReset.newPasswordPlaceholder", "Enter new password")
|
|
206
|
+
}),
|
|
207
|
+
/* @__PURE__ */ g("button", {
|
|
208
|
+
type: "button",
|
|
209
|
+
onClick: () => R(!L),
|
|
210
|
+
"aria-label": L ? "Hide password" : "Show password",
|
|
211
|
+
className: "absolute inset-y-0 right-0 pr-3.5 flex items-center text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] transition-colors",
|
|
212
|
+
children: g(L ? i : r, { className: "size-5" })
|
|
213
|
+
})
|
|
214
|
+
]
|
|
215
|
+
}),
|
|
216
|
+
N && /* @__PURE__ */ _("div", {
|
|
217
|
+
className: "space-y-3 pt-2",
|
|
218
|
+
children: [/* @__PURE__ */ _("div", {
|
|
219
|
+
className: "space-y-1",
|
|
220
|
+
children: [/* @__PURE__ */ g("div", {
|
|
221
|
+
className: "h-1.5 bg-[var(--color-bg-sunken)] rounded-full overflow-hidden",
|
|
222
|
+
children: /* @__PURE__ */ g("div", { className: `h-full ${J.color} ${J.width} transition-all duration-300` })
|
|
223
|
+
}), /* @__PURE__ */ _("p", {
|
|
224
|
+
className: "text-xs text-[var(--color-text-tertiary)] capitalize",
|
|
225
|
+
children: [
|
|
226
|
+
C("auth.passwordReset.passwordStrength", "Password strength:"),
|
|
227
|
+
" ",
|
|
228
|
+
/* @__PURE__ */ g("span", {
|
|
229
|
+
className: "font-medium",
|
|
230
|
+
children: J.level
|
|
231
|
+
})
|
|
232
|
+
]
|
|
233
|
+
})]
|
|
234
|
+
}), /* @__PURE__ */ g("div", {
|
|
235
|
+
className: "grid grid-cols-2 gap-2",
|
|
236
|
+
children: q.map((e) => /* @__PURE__ */ _("div", {
|
|
237
|
+
className: "flex items-center gap-2",
|
|
238
|
+
children: [e.met ? /* @__PURE__ */ g(t, { className: "size-4 text-status-success-text" }) : /* @__PURE__ */ g(s, { className: "size-4 text-[var(--color-text-tertiary)]" }), /* @__PURE__ */ g("span", {
|
|
239
|
+
className: `text-xs ${e.met ? "text-[var(--color-status-success-text)]" : "text-[var(--color-text-tertiary)]"}`,
|
|
240
|
+
children: e.label
|
|
241
|
+
})]
|
|
242
|
+
}, e.label))
|
|
243
|
+
})]
|
|
244
|
+
})
|
|
245
|
+
]
|
|
246
|
+
}),
|
|
247
|
+
/* @__PURE__ */ _("div", {
|
|
248
|
+
className: "space-y-2",
|
|
249
|
+
children: [
|
|
250
|
+
/* @__PURE__ */ g("label", {
|
|
251
|
+
htmlFor: "confirmPassword",
|
|
252
|
+
className: "block text-sm font-medium text-[var(--color-text-primary)]",
|
|
253
|
+
children: C("auth.passwordReset.confirmPasswordLabel", "Confirm Password")
|
|
254
|
+
}),
|
|
255
|
+
/* @__PURE__ */ _("div", {
|
|
256
|
+
className: "relative",
|
|
257
|
+
children: [
|
|
258
|
+
/* @__PURE__ */ g("div", {
|
|
259
|
+
className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
|
|
260
|
+
children: /* @__PURE__ */ g(a, { className: "size-5 text-[var(--color-text-tertiary)]" })
|
|
261
|
+
}),
|
|
262
|
+
/* @__PURE__ */ g("input", {
|
|
263
|
+
id: "confirmPassword",
|
|
264
|
+
type: z ? "text" : "password",
|
|
265
|
+
required: !0,
|
|
266
|
+
"aria-required": "true",
|
|
267
|
+
"aria-label": C("auth.passwordReset.confirmPasswordLabel", "Confirm Password"),
|
|
268
|
+
autoComplete: "new-password",
|
|
269
|
+
"aria-invalid": F.length > 0 && N !== F,
|
|
270
|
+
value: F,
|
|
271
|
+
onChange: (e) => I(e.target.value),
|
|
272
|
+
className: "block w-full pl-[3.5rem] pr-12 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
|
|
273
|
+
placeholder: C("auth.passwordReset.confirmPasswordPlaceholder", "Confirm new password")
|
|
274
|
+
}),
|
|
275
|
+
/* @__PURE__ */ g("button", {
|
|
276
|
+
type: "button",
|
|
277
|
+
onClick: () => B(!z),
|
|
278
|
+
"aria-label": z ? "Hide password" : "Show password",
|
|
279
|
+
className: "absolute inset-y-0 right-0 pr-3.5 flex items-center text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] transition-colors",
|
|
280
|
+
children: g(z ? i : r, { className: "size-5" })
|
|
281
|
+
})
|
|
282
|
+
]
|
|
283
|
+
}),
|
|
284
|
+
F && N !== F && /* @__PURE__ */ g("p", {
|
|
285
|
+
className: "text-xs text-[var(--color-status-error-text)]",
|
|
286
|
+
children: C("auth.passwordReset.passwordsMismatch", "Passwords do not match")
|
|
287
|
+
})
|
|
288
|
+
]
|
|
289
|
+
}),
|
|
290
|
+
/* @__PURE__ */ g(v, {
|
|
291
|
+
type: "submit",
|
|
292
|
+
disabled: k || F.length > 0 && N !== F,
|
|
293
|
+
variant: "default",
|
|
294
|
+
size: "lg",
|
|
295
|
+
className: "w-full font-semibold",
|
|
296
|
+
children: k ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(o, { className: "size-5 animate-spin" }), /* @__PURE__ */ g("span", { children: C("auth.passwordReset.resetting", "Resetting password...") })] }) : C("auth.passwordReset.resetButton", "Reset password")
|
|
297
|
+
})
|
|
298
|
+
]
|
|
299
|
+
}) : /* @__PURE__ */ _("form", {
|
|
300
|
+
onSubmit: async (e) => {
|
|
301
|
+
e.preventDefault(), W("");
|
|
143
302
|
try {
|
|
144
|
-
await
|
|
303
|
+
await D(j, await A("password_reset")), H(!0);
|
|
145
304
|
} catch (e) {
|
|
146
|
-
|
|
147
|
-
H(t === "TOKEN_EXPIRED" ? x("auth.passwordReset.errorTokenExpired", "This password reset link has expired. Please request a new one.") : t === "INVALID_TOKEN" ? x("auth.passwordReset.errorInvalidToken", "This password reset link is invalid or has already been used.") : x("auth.passwordReset.errorGeneric", "Failed to reset password. Please try again."));
|
|
305
|
+
W(C("auth.passwordReset.sendFailed", "Failed to send reset email. Please try again.")), console.error("Failed to request password reset:", e);
|
|
148
306
|
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
})
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
})
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
/* @__PURE__ */ g("label", {
|
|
175
|
-
htmlFor: "newPassword",
|
|
307
|
+
},
|
|
308
|
+
className: "space-y-5",
|
|
309
|
+
children: [
|
|
310
|
+
U && /* @__PURE__ */ _("div", {
|
|
311
|
+
className: "flex items-start gap-3 p-4 rounded-xl bg-[var(--color-status-error-bg-subtle)] border border-[var(--color-status-error-border)]",
|
|
312
|
+
children: [/* @__PURE__ */ g("svg", {
|
|
313
|
+
className: "size-5 text-[var(--color-status-error-text)] flex-shrink-0 mt-0.5",
|
|
314
|
+
fill: "none",
|
|
315
|
+
viewBox: "0 0 24 24",
|
|
316
|
+
stroke: "currentColor",
|
|
317
|
+
children: /* @__PURE__ */ g("path", {
|
|
318
|
+
strokeLinecap: "round",
|
|
319
|
+
strokeLinejoin: "round",
|
|
320
|
+
strokeWidth: 2,
|
|
321
|
+
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"
|
|
322
|
+
})
|
|
323
|
+
}), /* @__PURE__ */ g("p", {
|
|
324
|
+
className: "text-sm text-[var(--color-status-error-text)]",
|
|
325
|
+
children: U
|
|
326
|
+
})]
|
|
327
|
+
}),
|
|
328
|
+
/* @__PURE__ */ _("div", {
|
|
329
|
+
className: "space-y-2",
|
|
330
|
+
children: [/* @__PURE__ */ g("label", {
|
|
331
|
+
htmlFor: "email",
|
|
176
332
|
className: "block text-sm font-medium text-[var(--color-text-primary)]",
|
|
177
|
-
children:
|
|
178
|
-
}),
|
|
179
|
-
/* @__PURE__ */ _("div", {
|
|
333
|
+
children: C("auth.passwordReset.emailLabel", "Email address")
|
|
334
|
+
}), /* @__PURE__ */ _("div", {
|
|
180
335
|
className: "relative",
|
|
181
|
-
children: [
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
className: "block w-full pl-[3.5rem] pr-12 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
|
|
196
|
-
placeholder: x("auth.passwordReset.newPasswordPlaceholder", "Enter new password")
|
|
197
|
-
}),
|
|
198
|
-
/* @__PURE__ */ g("button", {
|
|
199
|
-
type: "button",
|
|
200
|
-
onClick: () => I(!F),
|
|
201
|
-
"aria-label": F ? "Hide password" : "Show password",
|
|
202
|
-
className: "absolute inset-y-0 right-0 pr-3.5 flex items-center text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] transition-colors",
|
|
203
|
-
children: g(F ? i : r, { className: "size-5" })
|
|
204
|
-
})
|
|
205
|
-
]
|
|
206
|
-
}),
|
|
207
|
-
j && /* @__PURE__ */ _("div", {
|
|
208
|
-
className: "space-y-3 pt-2",
|
|
209
|
-
children: [/* @__PURE__ */ _("div", {
|
|
210
|
-
className: "space-y-1",
|
|
211
|
-
children: [/* @__PURE__ */ g("div", {
|
|
212
|
-
className: "h-1.5 bg-[var(--color-bg-sunken)] rounded-full overflow-hidden",
|
|
213
|
-
children: /* @__PURE__ */ g("div", { className: `h-full ${K.color} ${K.width} transition-all duration-300` })
|
|
214
|
-
}), /* @__PURE__ */ _("p", {
|
|
215
|
-
className: "text-xs text-[var(--color-text-tertiary)] capitalize",
|
|
216
|
-
children: [
|
|
217
|
-
x("auth.passwordReset.passwordStrength", "Password strength:"),
|
|
218
|
-
" ",
|
|
219
|
-
/* @__PURE__ */ g("span", {
|
|
220
|
-
className: "font-medium",
|
|
221
|
-
children: K.level
|
|
222
|
-
})
|
|
223
|
-
]
|
|
224
|
-
})]
|
|
225
|
-
}), /* @__PURE__ */ g("div", {
|
|
226
|
-
className: "grid grid-cols-2 gap-2",
|
|
227
|
-
children: G.map((e) => /* @__PURE__ */ _("div", {
|
|
228
|
-
className: "flex items-center gap-2",
|
|
229
|
-
children: [e.met ? /* @__PURE__ */ g(t, { className: "size-4 text-status-success-text" }) : /* @__PURE__ */ g(s, { className: "size-4 text-[var(--color-text-tertiary)]" }), /* @__PURE__ */ g("span", {
|
|
230
|
-
className: `text-xs ${e.met ? "text-[var(--color-status-success-text)]" : "text-[var(--color-text-tertiary)]"}`,
|
|
231
|
-
children: e.label
|
|
232
|
-
})]
|
|
233
|
-
}, e.label))
|
|
336
|
+
children: [/* @__PURE__ */ g("div", {
|
|
337
|
+
className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
|
|
338
|
+
children: /* @__PURE__ */ g(n, { className: "size-5 text-[var(--color-text-tertiary)]" })
|
|
339
|
+
}), /* @__PURE__ */ g("input", {
|
|
340
|
+
id: "email",
|
|
341
|
+
type: "email",
|
|
342
|
+
required: !0,
|
|
343
|
+
"aria-required": "true",
|
|
344
|
+
"aria-label": C("auth.passwordReset.emailLabel", "Email address"),
|
|
345
|
+
autoComplete: "email",
|
|
346
|
+
value: j,
|
|
347
|
+
onChange: (e) => M(e.target.value),
|
|
348
|
+
className: "block w-full pl-[3.5rem] pr-4 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
|
|
349
|
+
placeholder: C("auth.passwordReset.emailPlaceholder", "you@example.com")
|
|
234
350
|
})]
|
|
235
|
-
})
|
|
236
|
-
]
|
|
237
|
-
}),
|
|
238
|
-
/* @__PURE__ */ _("div", {
|
|
239
|
-
className: "space-y-2",
|
|
240
|
-
children: [
|
|
241
|
-
/* @__PURE__ */ g("label", {
|
|
242
|
-
htmlFor: "confirmPassword",
|
|
243
|
-
className: "block text-sm font-medium text-[var(--color-text-primary)]",
|
|
244
|
-
children: x("auth.passwordReset.confirmPasswordLabel", "Confirm Password")
|
|
245
|
-
}),
|
|
246
|
-
/* @__PURE__ */ _("div", {
|
|
247
|
-
className: "relative",
|
|
248
|
-
children: [
|
|
249
|
-
/* @__PURE__ */ g("div", {
|
|
250
|
-
className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
|
|
251
|
-
children: /* @__PURE__ */ g(a, { className: "size-5 text-[var(--color-text-tertiary)]" })
|
|
252
|
-
}),
|
|
253
|
-
/* @__PURE__ */ g("input", {
|
|
254
|
-
id: "confirmPassword",
|
|
255
|
-
type: L ? "text" : "password",
|
|
256
|
-
required: !0,
|
|
257
|
-
"aria-required": "true",
|
|
258
|
-
"aria-label": x("auth.passwordReset.confirmPasswordLabel", "Confirm Password"),
|
|
259
|
-
autoComplete: "new-password",
|
|
260
|
-
"aria-invalid": N.length > 0 && j !== N,
|
|
261
|
-
value: N,
|
|
262
|
-
onChange: (e) => P(e.target.value),
|
|
263
|
-
className: "block w-full pl-[3.5rem] pr-12 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
|
|
264
|
-
placeholder: x("auth.passwordReset.confirmPasswordPlaceholder", "Confirm new password")
|
|
265
|
-
}),
|
|
266
|
-
/* @__PURE__ */ g("button", {
|
|
267
|
-
type: "button",
|
|
268
|
-
onClick: () => R(!L),
|
|
269
|
-
"aria-label": L ? "Hide password" : "Show password",
|
|
270
|
-
className: "absolute inset-y-0 right-0 pr-3.5 flex items-center text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] transition-colors",
|
|
271
|
-
children: g(L ? i : r, { className: "size-5" })
|
|
272
|
-
})
|
|
273
|
-
]
|
|
274
|
-
}),
|
|
275
|
-
N && j !== N && /* @__PURE__ */ g("p", {
|
|
276
|
-
className: "text-xs text-[var(--color-status-error-text)]",
|
|
277
|
-
children: x("auth.passwordReset.passwordsMismatch", "Passwords do not match")
|
|
278
|
-
})
|
|
279
|
-
]
|
|
280
|
-
}),
|
|
281
|
-
/* @__PURE__ */ g("button", {
|
|
282
|
-
type: "submit",
|
|
283
|
-
disabled: D || N.length > 0 && j !== N,
|
|
284
|
-
className: "auth-primary-button flex w-full items-center justify-center gap-2 px-4 py-3 font-semibold",
|
|
285
|
-
children: D ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(o, { className: "size-5 animate-spin" }), /* @__PURE__ */ g("span", { children: x("auth.passwordReset.resetting", "Resetting password...") })] }) : x("auth.passwordReset.resetButton", "Reset password")
|
|
286
|
-
})
|
|
287
|
-
]
|
|
288
|
-
}) : /* @__PURE__ */ _("form", {
|
|
289
|
-
onSubmit: async (e) => {
|
|
290
|
-
e.preventDefault(), H("");
|
|
291
|
-
try {
|
|
292
|
-
await T(k, await O("password_reset")), B(!0);
|
|
293
|
-
} catch (e) {
|
|
294
|
-
H(x("auth.passwordReset.sendFailed", "Failed to send reset email. Please try again.")), console.error("Failed to request password reset:", e);
|
|
295
|
-
}
|
|
296
|
-
},
|
|
297
|
-
className: "space-y-5",
|
|
298
|
-
children: [
|
|
299
|
-
V && /* @__PURE__ */ _("div", {
|
|
300
|
-
className: "flex items-start gap-3 p-4 rounded-xl bg-[var(--color-status-error-bg-subtle)] border border-[var(--color-status-error-border)]",
|
|
301
|
-
children: [/* @__PURE__ */ g("svg", {
|
|
302
|
-
className: "size-5 text-[var(--color-status-error-text)] flex-shrink-0 mt-0.5",
|
|
303
|
-
fill: "none",
|
|
304
|
-
viewBox: "0 0 24 24",
|
|
305
|
-
stroke: "currentColor",
|
|
306
|
-
children: /* @__PURE__ */ g("path", {
|
|
307
|
-
strokeLinecap: "round",
|
|
308
|
-
strokeLinejoin: "round",
|
|
309
|
-
strokeWidth: 2,
|
|
310
|
-
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"
|
|
311
|
-
})
|
|
312
|
-
}), /* @__PURE__ */ g("p", {
|
|
313
|
-
className: "text-sm text-[var(--color-status-error-text)]",
|
|
314
|
-
children: V
|
|
315
|
-
})]
|
|
316
|
-
}),
|
|
317
|
-
/* @__PURE__ */ _("div", {
|
|
318
|
-
className: "space-y-2",
|
|
319
|
-
children: [/* @__PURE__ */ g("label", {
|
|
320
|
-
htmlFor: "email",
|
|
321
|
-
className: "block text-sm font-medium text-[var(--color-text-primary)]",
|
|
322
|
-
children: x("auth.passwordReset.emailLabel", "Email address")
|
|
323
|
-
}), /* @__PURE__ */ _("div", {
|
|
324
|
-
className: "relative",
|
|
325
|
-
children: [/* @__PURE__ */ g("div", {
|
|
326
|
-
className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
|
|
327
|
-
children: /* @__PURE__ */ g(n, { className: "size-5 text-[var(--color-text-tertiary)]" })
|
|
328
|
-
}), /* @__PURE__ */ g("input", {
|
|
329
|
-
id: "email",
|
|
330
|
-
type: "email",
|
|
331
|
-
required: !0,
|
|
332
|
-
"aria-required": "true",
|
|
333
|
-
"aria-label": x("auth.passwordReset.emailLabel", "Email address"),
|
|
334
|
-
autoComplete: "email",
|
|
335
|
-
value: k,
|
|
336
|
-
onChange: (e) => A(e.target.value),
|
|
337
|
-
className: "block w-full pl-[3.5rem] pr-4 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
|
|
338
|
-
placeholder: x("auth.passwordReset.emailPlaceholder", "you@example.com")
|
|
339
351
|
})]
|
|
340
|
-
})
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
352
|
+
}),
|
|
353
|
+
/* @__PURE__ */ g(v, {
|
|
354
|
+
type: "submit",
|
|
355
|
+
disabled: k,
|
|
356
|
+
variant: "default",
|
|
357
|
+
size: "lg",
|
|
358
|
+
className: "w-full font-semibold",
|
|
359
|
+
children: k ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(o, { className: "size-5 animate-spin" }), /* @__PURE__ */ g("span", { children: C("auth.passwordReset.sending", "Sending...") })] }) : C("auth.passwordReset.sendResetLink", "Send reset link")
|
|
360
|
+
})
|
|
361
|
+
]
|
|
362
|
+
}),
|
|
363
|
+
/* @__PURE__ */ _("p", {
|
|
364
|
+
className: "mt-8 text-center text-sm text-[var(--color-text-secondary)]",
|
|
365
|
+
children: [
|
|
366
|
+
C("auth.passwordReset.rememberPassword", "Remember your password?"),
|
|
367
|
+
" ",
|
|
368
|
+
/* @__PURE__ */ g("button", {
|
|
369
|
+
type: "button",
|
|
370
|
+
onClick: () => x("/auth/login"),
|
|
371
|
+
className: "font-semibold text-text-link hover:text-text-linkHover transition-colors",
|
|
372
|
+
children: C("auth.passwordReset.signIn", "Sign in")
|
|
373
|
+
})
|
|
374
|
+
]
|
|
375
|
+
})
|
|
376
|
+
]
|
|
362
377
|
});
|
|
363
378
|
}
|
|
364
379
|
//#endregion
|
|
365
|
-
export {
|
|
380
|
+
export { x as PasswordResetPage };
|
|
366
381
|
|
|
367
382
|
//# sourceMappingURL=PasswordResetPage.js.map
|