@burdenoff/microfe-auth 2026.527.3 → 2026.528.2
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/components/profile/UserProfileMenu.js.map +1 -1
- package/dist/auth/hooks/useMfaOperations.js +22 -18
- package/dist/auth/hooks/useMfaOperations.js.map +1 -1
- package/dist/auth/pages/AuditLogPage.js.map +1 -1
- package/dist/auth/pages/EmailVerifyPage.js.map +1 -1
- package/dist/auth/pages/LoginPage.js +159 -151
- package/dist/auth/pages/LoginPage.js.map +1 -1
- package/dist/auth/pages/MagicLinkPage.js.map +1 -1
- package/dist/auth/pages/MfaSetupPage.js.map +1 -1
- package/dist/auth/pages/MfaVerifyPage.js +12 -11
- package/dist/auth/pages/MfaVerifyPage.js.map +1 -1
- package/dist/auth/pages/OAuthCallbackPage.js.map +1 -1
- package/dist/auth/pages/PasswordResetPage.js.map +1 -1
- package/dist/auth/pages/ReactivatePage.js.map +1 -1
- package/dist/auth/pages/RegisterPage.js.map +1 -1
- package/dist/auth/pages/SecurityPage.js.map +1 -1
- package/dist/auth/pages/SessionsPage.js.map +1 -1
- package/dist/auth/pages/SsoCallbackPage.js.map +1 -1
- package/dist/auth/pages/SsoConfigPage.js.map +1 -1
- package/dist/auth/pages/SsoLoginPage.js.map +1 -1
- package/dist/auth/pages/UserDetailsPage.js.map +1 -1
- package/dist/auth/pages/UserProfilePage.js.map +1 -1
- package/dist/auth/pages/UsersPage.js.map +1 -1
- package/dist/auth/providers/AuthProvider.js +8 -7
- package/dist/auth/providers/AuthProvider.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { useAuth as e } from "../providers/AuthProvider.js";
|
|
2
|
+
import { useAuthStore as t } from "../store/authStore.js";
|
|
3
|
+
import { useAuthOperations as n } from "../hooks/useAuthOperations.js";
|
|
4
|
+
import { useMyWorkspaces as r } from "../hooks/useMyWorkspaces.js";
|
|
5
|
+
import { useOAuthOperations as i } from "../hooks/useOAuthOperations.js";
|
|
6
|
+
import { AuthLayout as a } from "../components/AuthLayout.js";
|
|
7
|
+
import { AlertIcon as o, EmailIcon as s, EyeIcon as ee, EyeOffIcon as te, GoogleIcon as c, LockIcon as l, MicrosoftIcon as ne, SpinnerIcon as u } from "../components/AuthIcons.js";
|
|
8
|
+
import { useCaptchaV3 as re } from "../hooks/useCaptchaV3.js";
|
|
9
|
+
import { MFA_REDIRECT as ie } from "../constants/sessionKeys.js";
|
|
10
|
+
import { useCallback as d, useEffect as f, useRef as ae, useState as p } from "react";
|
|
11
|
+
import { SSORedirectSpinner as oe, getSSORedirectUrl as se } from "@burdenoff/fe-libs/shared/components";
|
|
12
|
+
import { useLocation as ce, useNavigate as le, useSearchParams as ue } from "react-router-dom";
|
|
13
|
+
import { useActiveContext as de, useI18n as fe } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
12
14
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
13
|
-
import { resolveAuthBridgeConfig as
|
|
14
|
-
import { getProfileTokens as
|
|
15
|
+
import { resolveAuthBridgeConfig as pe } from "@burdenoff/fe-libs/shared/config";
|
|
16
|
+
import { getProfileTokens as me, getProfileUser as he, getProfileWorkspaceToken as ge, getProfiles as _, resolveActiveProfileId as _e } from "@burdenoff/fe-libs/shared/providers/shell/ProfileStorageManager";
|
|
15
17
|
//#region src/auth/pages/LoginPage.tsx
|
|
16
|
-
function
|
|
18
|
+
function v() {
|
|
17
19
|
if (typeof window > "u") return !1;
|
|
18
20
|
let e = window;
|
|
19
21
|
if (typeof e.Capacitor?.isNativePlatform == "function") try {
|
|
@@ -21,7 +23,7 @@ function me() {
|
|
|
21
23
|
} catch {}
|
|
22
24
|
return !!(typeof navigator < "u" && /Electron/i.test(navigator.userAgent || ""));
|
|
23
25
|
}
|
|
24
|
-
function
|
|
26
|
+
function ve(e) {
|
|
25
27
|
if (typeof window > "u") return e;
|
|
26
28
|
try {
|
|
27
29
|
let t = new URL(e, window.location.origin);
|
|
@@ -30,7 +32,7 @@ function he(e) {
|
|
|
30
32
|
return e;
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
|
-
function
|
|
35
|
+
function ye(e) {
|
|
34
36
|
try {
|
|
35
37
|
let t = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "="), r = JSON.parse(atob(n));
|
|
36
38
|
return typeof r.exp == "number" && r.exp > Date.now() / 1e3;
|
|
@@ -38,16 +40,16 @@ function ge(e) {
|
|
|
38
40
|
return !1;
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
|
-
function
|
|
43
|
+
function be(e) {
|
|
42
44
|
if (!e) return null;
|
|
43
45
|
try {
|
|
44
46
|
let t = new URL(decodeURIComponent(e), window.location.origin);
|
|
45
|
-
return t.origin === window.location.origin ?
|
|
47
|
+
return t.origin === window.location.origin ? y(t, { includeOrigin: !1 }) : null;
|
|
46
48
|
} catch {
|
|
47
49
|
return null;
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
|
-
function
|
|
52
|
+
function y(e, t) {
|
|
51
53
|
for (let t of [
|
|
52
54
|
"sso_failed",
|
|
53
55
|
"sso-failed",
|
|
@@ -57,37 +59,37 @@ function b(e, t) {
|
|
|
57
59
|
let n = e.searchParams.toString();
|
|
58
60
|
return `${e.pathname}${n ? `?${n}` : ""}${e.hash}`;
|
|
59
61
|
}
|
|
60
|
-
function
|
|
62
|
+
function xe(e) {
|
|
61
63
|
try {
|
|
62
64
|
let t = new URL(decodeURIComponent(e), window.location.origin);
|
|
63
|
-
return
|
|
65
|
+
return y(t, { includeOrigin: t.origin !== window.location.origin });
|
|
64
66
|
} catch {
|
|
65
67
|
return e;
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
|
-
function
|
|
69
|
-
let
|
|
70
|
-
let n =
|
|
70
|
+
function b() {
|
|
71
|
+
let y = le(), b = ce(), [x] = ue(), { t: Se } = fe(), S = d((e, t) => {
|
|
72
|
+
let n = Se(e);
|
|
71
73
|
return n === e ? t : n;
|
|
72
|
-
}, [
|
|
73
|
-
if (typeof window > "u" ||
|
|
74
|
+
}, [Se]), { signIn: Ce, isLoading: C, error: w, errorCode: T, resendVerification: we } = n(), { completeAuthFlow: Te } = r(), { setWorkspace: E, setOrganization: D } = de(), { defaultPostLoginPath: O } = e(), { initiateGoogleOAuth: Ee, initiateMicrosoftOAuth: De, isProviderConfigured: k } = i(), A = t((e) => e.mfaRequired), { executeRecaptcha: Oe } = re(), [j, M] = p(!1), [ke, Ae] = p(!1), N = d((e) => {
|
|
75
|
+
if (typeof window > "u" || v()) return e;
|
|
74
76
|
try {
|
|
75
|
-
let t =
|
|
77
|
+
let t = pe(), n = new URL(t.url), r = window.location.origin;
|
|
76
78
|
if (n.origin === r) return e;
|
|
77
|
-
let i = new URL(e, r).href, a =
|
|
79
|
+
let i = new URL(e, r).href, a = _e();
|
|
78
80
|
if (!a) return e;
|
|
79
|
-
let o =
|
|
81
|
+
let o = me(a), s = he(a);
|
|
80
82
|
if (!o || !s) return e;
|
|
81
|
-
let
|
|
83
|
+
let ee = ge(a), te = {
|
|
82
84
|
profileId: a,
|
|
83
85
|
tokens: JSON.stringify({
|
|
84
86
|
...o,
|
|
85
|
-
workspaceToken:
|
|
87
|
+
workspaceToken: ee
|
|
86
88
|
}),
|
|
87
89
|
user: JSON.stringify(s),
|
|
88
|
-
profiles: JSON.stringify(
|
|
89
|
-
},
|
|
90
|
-
return
|
|
90
|
+
profiles: JSON.stringify(_())
|
|
91
|
+
}, c = btoa(JSON.stringify(te)), l = new URL("/auth/sso-deposit", n.origin);
|
|
92
|
+
return l.searchParams.set("returnTo", i), `${l.href}#sso=${c}`;
|
|
91
93
|
} catch {
|
|
92
94
|
return e;
|
|
93
95
|
}
|
|
@@ -96,33 +98,33 @@ function x() {
|
|
|
96
98
|
try {
|
|
97
99
|
sessionStorage.setItem("bf-post-login-return-to", e);
|
|
98
100
|
} catch {}
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
+
if (v()) {
|
|
102
|
+
y(ve(e));
|
|
101
103
|
return;
|
|
102
104
|
}
|
|
103
105
|
window.location.assign(N(e));
|
|
104
106
|
return;
|
|
105
107
|
}
|
|
106
|
-
|
|
107
|
-
}, [
|
|
108
|
+
y(e);
|
|
109
|
+
}, [y, N]), [F, je] = p(!1), [I, L] = p(!1), [Me, R] = p(!1), [Ne, z] = p(!1), [B, V] = p(!1), [H, U] = p(!1), [Pe, Fe] = p(!1), [Ie, W] = p(!1), [Le, G] = p(null), [Re, ze] = p(null), [K, q] = p({
|
|
108
110
|
email: "",
|
|
109
111
|
password: "",
|
|
110
112
|
rememberMe: !1
|
|
111
|
-
}), [J, Y] = p(null), [
|
|
113
|
+
}), [J, Y] = p(null), [Be, X] = p(!1), Z = x.get("mode") === "add-account", Q = x.get("returnTo"), $ = ae(Q);
|
|
112
114
|
f(() => {
|
|
113
115
|
!$.current && Q && ($.current = Q);
|
|
114
116
|
}, [Q]), f(() => {
|
|
115
117
|
if (Z || j) return;
|
|
116
|
-
let
|
|
117
|
-
if (
|
|
118
|
-
let n =
|
|
119
|
-
if (n?.accessToken && r &&
|
|
120
|
-
|
|
118
|
+
let e = _e();
|
|
119
|
+
if (e) {
|
|
120
|
+
let n = me(e), r = he(e);
|
|
121
|
+
if (n?.accessToken && r && ye(n.accessToken)) {
|
|
122
|
+
t.getState().loadFromProfile(e), P(be(Q) ?? "/");
|
|
121
123
|
return;
|
|
122
124
|
}
|
|
123
125
|
}
|
|
124
|
-
let n =
|
|
125
|
-
n && (
|
|
126
|
+
let n = se();
|
|
127
|
+
n && (Ae(!0), window.location.replace(n));
|
|
126
128
|
}, [
|
|
127
129
|
Z,
|
|
128
130
|
j,
|
|
@@ -141,13 +143,13 @@ function x() {
|
|
|
141
143
|
console.warn("[LoginPage] Failed to load remembered email:", e);
|
|
142
144
|
}
|
|
143
145
|
}, []), f(() => {
|
|
144
|
-
let e =
|
|
145
|
-
e?.message &&
|
|
146
|
+
let e = b.state;
|
|
147
|
+
e?.message && ze(e.message), e?.email && q((t) => ({
|
|
146
148
|
...t,
|
|
147
149
|
email: e.email
|
|
148
150
|
})), e && window.history.replaceState({}, document.title);
|
|
149
|
-
}, [
|
|
150
|
-
let
|
|
151
|
+
}, [b.state]);
|
|
152
|
+
let Ve = (e, t) => {
|
|
151
153
|
if (t) switch (t) {
|
|
152
154
|
case "ACCOUNT_DELETED": return "DELETED";
|
|
153
155
|
case "ACCOUNT_SUSPENDED": return "SUSPENDED";
|
|
@@ -161,46 +163,52 @@ function x() {
|
|
|
161
163
|
return n.includes("deleted") || n.includes("permanently deleted") ? "DELETED" : n.includes("suspended") ? "SUSPENDED" : n.includes("oauth provider") || n.includes("oauth-only") || n.includes("oauth only") ? "OAUTH_ONLY" : n.includes("inactive") || n.includes("deactivated") || n.includes("not active") ? "INACTIVE" : n.includes("verify your email") || n.includes("email not verified") || n.includes("email_not_verified") ? "EMAIL_NOT_VERIFIED" : null;
|
|
162
164
|
};
|
|
163
165
|
f(() => {
|
|
164
|
-
let e =
|
|
166
|
+
let e = x.get("email");
|
|
165
167
|
if (e && q((t) => ({
|
|
166
168
|
...t,
|
|
167
169
|
email: e
|
|
168
|
-
})),
|
|
169
|
-
|
|
170
|
+
})), x.get("expired") === "true") {
|
|
171
|
+
ze(S("auth.login.sessionExpired", "Your session has expired. Please sign in again."));
|
|
170
172
|
let e = window.location.pathname;
|
|
171
173
|
window.history.replaceState({}, document.title, e);
|
|
172
174
|
}
|
|
173
|
-
}, [
|
|
174
|
-
A &&
|
|
175
|
-
}, [A,
|
|
176
|
-
let
|
|
177
|
-
|
|
175
|
+
}, [x, S]), f(() => {
|
|
176
|
+
A && y("/auth/mfa-verify");
|
|
177
|
+
}, [A, y]);
|
|
178
|
+
let He = async (e) => {
|
|
179
|
+
e.preventDefault(), L(!1), R(!1), z(!1), V(!1), U(!1), X(!1), W(!1), Y(null);
|
|
178
180
|
let n = (K.email ?? "").trim();
|
|
179
181
|
if (!n) {
|
|
180
|
-
Y(
|
|
182
|
+
Y(S("auth.login.enterEmailOrUsername", "Please enter your email or username"));
|
|
181
183
|
return;
|
|
182
184
|
}
|
|
183
185
|
if (n.includes("@") && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)) {
|
|
184
|
-
Y(
|
|
186
|
+
Y(S("auth.login.invalidEmail", "Please enter a valid email address"));
|
|
185
187
|
return;
|
|
186
188
|
}
|
|
187
189
|
if (!K.password || K.password.length < 1) {
|
|
188
|
-
Y(
|
|
190
|
+
Y(S("auth.login.enterPassword", "Please enter your password"));
|
|
189
191
|
return;
|
|
190
192
|
}
|
|
191
|
-
if (Z &&
|
|
193
|
+
if (Z && _().some((e) => e.email.toLowerCase() === n.toLowerCase())) {
|
|
192
194
|
X(!0), Y(null);
|
|
193
195
|
return;
|
|
194
196
|
}
|
|
195
197
|
X(!1);
|
|
196
198
|
try {
|
|
197
|
-
let e = await
|
|
199
|
+
let e = await Oe("login"), t = await Ce({
|
|
198
200
|
email: n,
|
|
199
201
|
password: K.password,
|
|
200
202
|
rememberMe: K.rememberMe,
|
|
201
203
|
...e ? { recaptchaToken: e } : {}
|
|
202
204
|
});
|
|
203
|
-
if (t.requiresMFA)
|
|
205
|
+
if (t.requiresMFA) {
|
|
206
|
+
let e = xe($.current || Q || (O ?? "/dashboard"));
|
|
207
|
+
try {
|
|
208
|
+
sessionStorage.setItem(ie, e);
|
|
209
|
+
} catch {}
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
204
212
|
if (t.success) {
|
|
205
213
|
try {
|
|
206
214
|
let e = t.user?.id;
|
|
@@ -218,9 +226,9 @@ function x() {
|
|
|
218
226
|
console.warn("[LoginPage] Failed to save/clear remembered email:", e);
|
|
219
227
|
}
|
|
220
228
|
M(!0);
|
|
221
|
-
let e = $.current || Q
|
|
229
|
+
let e = xe($.current || Q || (O ?? "/dashboard"));
|
|
222
230
|
try {
|
|
223
|
-
let
|
|
231
|
+
let n = await Promise.race([Te(t.token), new Promise((e) => {
|
|
224
232
|
window.setTimeout(() => {
|
|
225
233
|
e({
|
|
226
234
|
success: !1,
|
|
@@ -228,71 +236,71 @@ function x() {
|
|
|
228
236
|
});
|
|
229
237
|
}, 5e3);
|
|
230
238
|
})]);
|
|
231
|
-
|
|
232
|
-
} catch (
|
|
233
|
-
console.error("Auth flow error (login succeeded):",
|
|
239
|
+
n.success ? (n.workspace && (E(n.workspace.id), n.workspace.organizationId && D(n.workspace.organizationId)), P(e)) : n.error?.includes("No workspaces found") ? y("/onboarding/create-workspace") : (n.workspace && (E(n.workspace.id), n.workspace.organizationId && D(n.workspace.organizationId)), console.warn("Auth flow warning:", n.error), P(e));
|
|
240
|
+
} catch (t) {
|
|
241
|
+
console.error("Auth flow error (login succeeded):", t), P(e);
|
|
234
242
|
} finally {
|
|
235
243
|
M(!1);
|
|
236
244
|
}
|
|
237
245
|
}
|
|
238
|
-
} catch (
|
|
239
|
-
let n =
|
|
246
|
+
} catch (e) {
|
|
247
|
+
let n = e instanceof Error ? e.message : String(e);
|
|
240
248
|
n.includes("reCAPTCHA") && Y(n);
|
|
241
|
-
let r =
|
|
249
|
+
let r = t.getState().errorCode, i = Ve(n, r);
|
|
242
250
|
i === "DELETED" ? R(!0) : i === "SUSPENDED" ? z(!0) : i === "OAUTH_ONLY" ? V(!0) : i === "INACTIVE" ? L(!0) : i === "EMAIL_NOT_VERIFIED" && U(!0);
|
|
243
251
|
}
|
|
244
252
|
};
|
|
245
253
|
f(() => {
|
|
246
|
-
if (
|
|
247
|
-
let e =
|
|
254
|
+
if (w) {
|
|
255
|
+
let e = Ve(w, T);
|
|
248
256
|
e === "DELETED" ? R(!0) : e === "SUSPENDED" ? z(!0) : e === "OAUTH_ONLY" ? V(!0) : e === "INACTIVE" ? L(!0) : e === "EMAIL_NOT_VERIFIED" && U(!0);
|
|
249
257
|
}
|
|
250
|
-
}, [
|
|
251
|
-
let
|
|
258
|
+
}, [w, T]);
|
|
259
|
+
let Ue = () => {
|
|
252
260
|
G(null);
|
|
253
261
|
try {
|
|
254
|
-
|
|
262
|
+
Ee();
|
|
255
263
|
} catch (e) {
|
|
256
|
-
G(e instanceof Error ? e.message :
|
|
264
|
+
G(e instanceof Error ? e.message : S("auth.login.googleSignInFailed", "Failed to initiate Google sign in"));
|
|
257
265
|
}
|
|
258
|
-
},
|
|
266
|
+
}, We = () => {
|
|
259
267
|
G(null);
|
|
260
268
|
try {
|
|
261
|
-
|
|
269
|
+
De();
|
|
262
270
|
} catch (e) {
|
|
263
|
-
G(e instanceof Error ? e.message :
|
|
271
|
+
G(e instanceof Error ? e.message : S("auth.login.microsoftSignInFailed", "Failed to initiate Microsoft sign in"));
|
|
264
272
|
}
|
|
265
|
-
},
|
|
266
|
-
|
|
273
|
+
}, Ge = async () => {
|
|
274
|
+
Fe(!0), W(!1);
|
|
267
275
|
try {
|
|
268
|
-
(await
|
|
276
|
+
(await we((K.email ?? "").trim())).success ? W(!0) : Y(S("auth.login.resendFailed", "Failed to resend verification email. Please try again."));
|
|
269
277
|
} catch (e) {
|
|
270
|
-
console.error("Failed to resend verification email:", e), Y(e instanceof Error ? e.message :
|
|
278
|
+
console.error("Failed to resend verification email:", e), Y(e instanceof Error ? e.message : S("auth.login.resendFailed", "Failed to resend verification email. Please try again."));
|
|
271
279
|
} finally {
|
|
272
|
-
|
|
280
|
+
Fe(!1);
|
|
273
281
|
}
|
|
274
|
-
},
|
|
282
|
+
}, Ke = k("google"), qe = k("microsoft"), Je = [{
|
|
275
283
|
name: "Google",
|
|
276
|
-
icon:
|
|
277
|
-
onClick:
|
|
278
|
-
disabled: !
|
|
279
|
-
tooltip:
|
|
284
|
+
icon: c,
|
|
285
|
+
onClick: Ue,
|
|
286
|
+
disabled: !Ke,
|
|
287
|
+
tooltip: Ke ? void 0 : S("auth.login.googleNotConfigured", "Google sign in is not configured")
|
|
280
288
|
}, {
|
|
281
289
|
name: "Microsoft",
|
|
282
|
-
icon:
|
|
283
|
-
onClick:
|
|
284
|
-
disabled: !
|
|
285
|
-
tooltip:
|
|
290
|
+
icon: ne,
|
|
291
|
+
onClick: We,
|
|
292
|
+
disabled: !qe,
|
|
293
|
+
tooltip: qe ? void 0 : S("auth.login.microsoftNotConfigured", "Microsoft sign in is not configured")
|
|
286
294
|
}];
|
|
287
|
-
return
|
|
288
|
-
title:
|
|
289
|
-
subtitle:
|
|
295
|
+
return ke ? /* @__PURE__ */ h(oe, {}) : /* @__PURE__ */ g(a, {
|
|
296
|
+
title: S("auth.login.welcomeBack", "Welcome back"),
|
|
297
|
+
subtitle: S("auth.login.enterCredentials", "Enter your credentials to continue"),
|
|
290
298
|
children: [
|
|
291
299
|
/* @__PURE__ */ g("form", {
|
|
292
|
-
onSubmit:
|
|
300
|
+
onSubmit: He,
|
|
293
301
|
className: "space-y-5",
|
|
294
302
|
children: [
|
|
295
|
-
|
|
303
|
+
Re && /* @__PURE__ */ g("div", {
|
|
296
304
|
className: "flex items-start gap-3 p-4 rounded-xl border bg-status-info-bg-subtle border-status-info-border",
|
|
297
305
|
children: [/* @__PURE__ */ h("svg", {
|
|
298
306
|
className: "size-5 flex-shrink-0 mt-0.5 text-text-link",
|
|
@@ -307,32 +315,32 @@ function x() {
|
|
|
307
315
|
})
|
|
308
316
|
}), /* @__PURE__ */ h("p", {
|
|
309
317
|
className: "text-sm text-status-info-text",
|
|
310
|
-
children:
|
|
318
|
+
children: Re
|
|
311
319
|
})]
|
|
312
320
|
}),
|
|
313
321
|
J && /* @__PURE__ */ g("div", {
|
|
314
322
|
className: "flex items-start gap-3 p-4 rounded-xl border bg-status-warning-bg-subtle border-status-warning-border",
|
|
315
|
-
children: [/* @__PURE__ */ h(
|
|
323
|
+
children: [/* @__PURE__ */ h(o, { className: "size-5 flex-shrink-0 mt-0.5 text-status-warning-text" }), /* @__PURE__ */ h("p", {
|
|
316
324
|
className: "text-sm text-status-warning-text",
|
|
317
325
|
children: J
|
|
318
326
|
})]
|
|
319
327
|
}),
|
|
320
|
-
|
|
328
|
+
Be && /* @__PURE__ */ g("div", {
|
|
321
329
|
className: "flex items-start gap-3 p-4 rounded-xl border bg-status-warning-bg-subtle border-status-warning-border",
|
|
322
|
-
children: [/* @__PURE__ */ h(
|
|
330
|
+
children: [/* @__PURE__ */ h(o, { className: "size-5 flex-shrink-0 mt-0.5 text-status-warning-text" }), /* @__PURE__ */ g("div", {
|
|
323
331
|
className: "flex-1",
|
|
324
332
|
children: [
|
|
325
333
|
/* @__PURE__ */ h("p", {
|
|
326
334
|
className: "text-sm font-medium text-status-warning-text",
|
|
327
|
-
children:
|
|
335
|
+
children: S("auth.login.duplicateAccount", "This account is already signed in.")
|
|
328
336
|
}),
|
|
329
337
|
/* @__PURE__ */ h("p", {
|
|
330
338
|
className: "mt-1 text-sm text-status-warning-text/80",
|
|
331
|
-
children:
|
|
339
|
+
children: S("auth.login.duplicateAccountHint", "Please use a different account, or go back and switch to this account from the profile menu.")
|
|
332
340
|
}),
|
|
333
341
|
($.current || Q) && /* @__PURE__ */ g("button", {
|
|
334
342
|
type: "button",
|
|
335
|
-
onClick: () =>
|
|
343
|
+
onClick: () => y(decodeURIComponent($.current || Q || "/dashboard")),
|
|
336
344
|
className: "mt-3 inline-flex items-center gap-2 px-4 py-2.5 rounded-xl border border-status-warning-border bg-bg-surface text-status-warning-text text-sm font-medium hover:bg-status-warning-bg-subtle hover:border-status-warning-border transition-all shadow-sm",
|
|
337
345
|
children: [/* @__PURE__ */ h("svg", {
|
|
338
346
|
className: "size-4",
|
|
@@ -345,29 +353,29 @@ function x() {
|
|
|
345
353
|
strokeWidth: 2,
|
|
346
354
|
d: "M10 19l-7-7m0 0l7-7m-7 7h18"
|
|
347
355
|
})
|
|
348
|
-
}),
|
|
356
|
+
}), S("auth.login.goBackSwitchAccount", "Go back and switch account")]
|
|
349
357
|
})
|
|
350
358
|
]
|
|
351
359
|
})]
|
|
352
360
|
}),
|
|
353
|
-
|
|
361
|
+
w && !J && !Be && /* @__PURE__ */ g("div", {
|
|
354
362
|
className: `flex items-start gap-3 p-4 rounded-xl border ${I || B || H ? "bg-status-warning-bg-subtle border-status-warning-border" : "bg-status-error-bg-subtle border-status-error-border"}`,
|
|
355
|
-
children: [/* @__PURE__ */ h(
|
|
363
|
+
children: [/* @__PURE__ */ h(o, { className: `size-5 flex-shrink-0 mt-0.5 ${I || B || H ? "text-status-warning-text" : "text-status-error-text"}` }), /* @__PURE__ */ g("div", {
|
|
356
364
|
className: "flex-1",
|
|
357
365
|
children: [
|
|
358
366
|
/* @__PURE__ */ h("p", {
|
|
359
367
|
className: `text-sm ${I || B || H ? "text-status-warning-text" : "text-status-error-text"}`,
|
|
360
|
-
children:
|
|
368
|
+
children: Me ? S("auth.login.accountDeleted", "This account has been permanently deleted and cannot be recovered.") : Ne ? S("auth.login.accountSuspended", "Your account has been suspended. Please contact support for assistance.") : I ? S("auth.login.accountDeactivated", "Your account has been deactivated.") : B ? S("auth.login.oauthOnly", "This account uses OAuth sign-in. Please use Google or Microsoft to sign in.") : H ? S("auth.login.emailNotVerified", "Please verify your email before signing in. Check your inbox for the verification link.") : w
|
|
361
369
|
}),
|
|
362
370
|
I && /* @__PURE__ */ h("button", {
|
|
363
371
|
type: "button",
|
|
364
|
-
onClick: () =>
|
|
372
|
+
onClick: () => y("/auth/reactivate", { state: { email: K.email } }),
|
|
365
373
|
className: "mt-2 text-sm font-semibold text-status-warning-text hover:text-status-warning-text underline underline-offset-2",
|
|
366
|
-
children:
|
|
374
|
+
children: S("auth.login.clickReactivate", "Click here to reactivate your account")
|
|
367
375
|
}),
|
|
368
376
|
H && /* @__PURE__ */ h("div", {
|
|
369
377
|
className: "mt-3",
|
|
370
|
-
children:
|
|
378
|
+
children: Ie ? /* @__PURE__ */ g("div", {
|
|
371
379
|
className: "flex items-center gap-2 text-sm text-status-success-text",
|
|
372
380
|
children: [/* @__PURE__ */ h("svg", {
|
|
373
381
|
className: "size-4",
|
|
@@ -380,13 +388,13 @@ function x() {
|
|
|
380
388
|
strokeWidth: 2,
|
|
381
389
|
d: "M5 13l4 4L19 7"
|
|
382
390
|
})
|
|
383
|
-
}),
|
|
391
|
+
}), S("auth.login.verificationSent", "Verification email sent! Please check your inbox.")]
|
|
384
392
|
}) : /* @__PURE__ */ h("button", {
|
|
385
393
|
type: "button",
|
|
386
|
-
onClick:
|
|
387
|
-
disabled:
|
|
394
|
+
onClick: Ge,
|
|
395
|
+
disabled: Pe,
|
|
388
396
|
className: "inline-flex items-center gap-2 px-4 py-2.5 rounded-xl border border-status-warning-border bg-bg-surface text-status-warning-text text-sm font-medium hover:bg-status-warning-bg-subtle hover:border-status-warning-border transition-all shadow-sm disabled:opacity-50 disabled:cursor-not-allowed",
|
|
389
|
-
children:
|
|
397
|
+
children: Pe ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(u, { className: "size-4 animate-spin" }), S("auth.login.sending", "Sending...")] }) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("svg", {
|
|
390
398
|
className: "size-4",
|
|
391
399
|
fill: "none",
|
|
392
400
|
viewBox: "0 0 24 24",
|
|
@@ -397,21 +405,21 @@ function x() {
|
|
|
397
405
|
strokeWidth: 2,
|
|
398
406
|
d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
|
|
399
407
|
})
|
|
400
|
-
}),
|
|
408
|
+
}), S("auth.login.resendVerification", "Resend verification email")] })
|
|
401
409
|
})
|
|
402
410
|
}),
|
|
403
411
|
B && /* @__PURE__ */ g("div", {
|
|
404
412
|
className: "mt-3 flex flex-col gap-2",
|
|
405
413
|
children: [k("google") && /* @__PURE__ */ g("button", {
|
|
406
414
|
type: "button",
|
|
407
|
-
onClick:
|
|
415
|
+
onClick: Ue,
|
|
408
416
|
className: "inline-flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl border border-border-default bg-bg-surface text-text-primary text-sm font-medium hover:bg-bg-canvas hover:border-border-default transition-all shadow-sm",
|
|
409
|
-
children: [/* @__PURE__ */ h(
|
|
417
|
+
children: [/* @__PURE__ */ h(c, { className: "size-5" }), S("auth.login.signInWithGoogle", "Sign in with Google")]
|
|
410
418
|
}), k("microsoft") && /* @__PURE__ */ g("button", {
|
|
411
419
|
type: "button",
|
|
412
|
-
onClick:
|
|
420
|
+
onClick: We,
|
|
413
421
|
className: "inline-flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl border border-border-default bg-bg-surface text-text-primary text-sm font-medium hover:bg-bg-canvas hover:border-border-default transition-all shadow-sm",
|
|
414
|
-
children: [/* @__PURE__ */ h(
|
|
422
|
+
children: [/* @__PURE__ */ h(ne, { className: "size-5" }), S("auth.login.signInWithMicrosoft", "Sign in with Microsoft")]
|
|
415
423
|
})]
|
|
416
424
|
})
|
|
417
425
|
]
|
|
@@ -422,26 +430,26 @@ function x() {
|
|
|
422
430
|
children: [/* @__PURE__ */ h("label", {
|
|
423
431
|
htmlFor: "email",
|
|
424
432
|
className: "block text-sm font-medium text-[var(--color-text-primary)]",
|
|
425
|
-
children:
|
|
433
|
+
children: S("auth.login.emailLabel", "Email")
|
|
426
434
|
}), /* @__PURE__ */ g("div", {
|
|
427
435
|
className: "relative",
|
|
428
436
|
children: [/* @__PURE__ */ h("div", {
|
|
429
437
|
className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
|
|
430
|
-
children: /* @__PURE__ */ h(
|
|
438
|
+
children: /* @__PURE__ */ h(s, { className: "size-5 text-[var(--color-text-tertiary)]" })
|
|
431
439
|
}), /* @__PURE__ */ h("input", {
|
|
432
440
|
id: "email",
|
|
433
441
|
type: "email",
|
|
434
442
|
autoComplete: "email",
|
|
435
443
|
required: !0,
|
|
436
444
|
"aria-required": "true",
|
|
437
|
-
"aria-label":
|
|
445
|
+
"aria-label": S("auth.login.emailLabel", "Email"),
|
|
438
446
|
value: K.email,
|
|
439
447
|
onChange: (e) => q({
|
|
440
448
|
...K,
|
|
441
449
|
email: e.target.value
|
|
442
450
|
}),
|
|
443
451
|
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",
|
|
444
|
-
placeholder:
|
|
452
|
+
placeholder: S("auth.login.emailPlaceholder", "you@example.com")
|
|
445
453
|
})]
|
|
446
454
|
})]
|
|
447
455
|
}),
|
|
@@ -450,13 +458,13 @@ function x() {
|
|
|
450
458
|
children: [/* @__PURE__ */ h("label", {
|
|
451
459
|
htmlFor: "password",
|
|
452
460
|
className: "block text-sm font-medium text-[var(--color-text-primary)]",
|
|
453
|
-
children:
|
|
461
|
+
children: S("auth.login.passwordLabel", "Password")
|
|
454
462
|
}), /* @__PURE__ */ g("div", {
|
|
455
463
|
className: "relative",
|
|
456
464
|
children: [
|
|
457
465
|
/* @__PURE__ */ h("div", {
|
|
458
466
|
className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
|
|
459
|
-
children: /* @__PURE__ */ h(
|
|
467
|
+
children: /* @__PURE__ */ h(l, { className: "size-5 text-[var(--color-text-tertiary)]" })
|
|
460
468
|
}),
|
|
461
469
|
/* @__PURE__ */ h("input", {
|
|
462
470
|
id: "password",
|
|
@@ -464,21 +472,21 @@ function x() {
|
|
|
464
472
|
autoComplete: "current-password",
|
|
465
473
|
required: !0,
|
|
466
474
|
"aria-required": "true",
|
|
467
|
-
"aria-label":
|
|
475
|
+
"aria-label": S("auth.login.passwordLabel", "Password"),
|
|
468
476
|
value: K.password,
|
|
469
477
|
onChange: (e) => q({
|
|
470
478
|
...K,
|
|
471
479
|
password: e.target.value
|
|
472
480
|
}),
|
|
473
481
|
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",
|
|
474
|
-
placeholder:
|
|
482
|
+
placeholder: S("auth.login.passwordPlaceholder", "Enter your password")
|
|
475
483
|
}),
|
|
476
484
|
/* @__PURE__ */ h("button", {
|
|
477
485
|
type: "button",
|
|
478
|
-
onClick: () =>
|
|
486
|
+
onClick: () => je(!F),
|
|
479
487
|
"aria-label": F ? "Hide password" : "Show password",
|
|
480
488
|
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",
|
|
481
|
-
children: h(F ?
|
|
489
|
+
children: h(F ? te : ee, { className: "size-5" })
|
|
482
490
|
})
|
|
483
491
|
]
|
|
484
492
|
})]
|
|
@@ -491,7 +499,7 @@ function x() {
|
|
|
491
499
|
className: "relative",
|
|
492
500
|
children: [/* @__PURE__ */ h("input", {
|
|
493
501
|
type: "checkbox",
|
|
494
|
-
"aria-label":
|
|
502
|
+
"aria-label": S("auth.login.rememberMe", "Remember me"),
|
|
495
503
|
checked: K.rememberMe,
|
|
496
504
|
onChange: (e) => {
|
|
497
505
|
let t = e.target.checked;
|
|
@@ -522,20 +530,20 @@ function x() {
|
|
|
522
530
|
})]
|
|
523
531
|
}), /* @__PURE__ */ h("span", {
|
|
524
532
|
className: "text-sm text-[var(--color-text-secondary)] group-hover:text-[var(--color-text-primary)] transition-colors",
|
|
525
|
-
children:
|
|
533
|
+
children: S("auth.login.rememberMe", "Remember me")
|
|
526
534
|
})]
|
|
527
535
|
}), /* @__PURE__ */ h("button", {
|
|
528
536
|
type: "button",
|
|
529
|
-
onClick: () =>
|
|
537
|
+
onClick: () => y("/auth/reset-password"),
|
|
530
538
|
className: "text-sm font-medium text-text-link hover:text-text-linkHover transition-colors",
|
|
531
|
-
children:
|
|
539
|
+
children: S("auth.login.forgotPassword", "Forgot password?")
|
|
532
540
|
})]
|
|
533
541
|
}),
|
|
534
542
|
/* @__PURE__ */ h("button", {
|
|
535
543
|
type: "submit",
|
|
536
|
-
disabled:
|
|
544
|
+
disabled: C || j,
|
|
537
545
|
className: "auth-primary-button flex w-full items-center justify-center gap-2 px-4 py-3 font-semibold",
|
|
538
|
-
children:
|
|
546
|
+
children: C || j ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(u, { className: "size-5 animate-spin" }), /* @__PURE__ */ h("span", { children: j ? S("auth.login.settingUpWorkspace", "Setting up workspace...") : S("auth.login.signingIn", "Signing in...") })] }) : S("auth.login.signIn", "Sign in")
|
|
539
547
|
})
|
|
540
548
|
]
|
|
541
549
|
}),
|
|
@@ -548,20 +556,20 @@ function x() {
|
|
|
548
556
|
className: "relative flex justify-center",
|
|
549
557
|
children: /* @__PURE__ */ h("span", {
|
|
550
558
|
className: "px-4 bg-[var(--color-bg-canvas)] text-sm text-[var(--color-text-tertiary)]",
|
|
551
|
-
children:
|
|
559
|
+
children: S("auth.login.orContinueWith", "or continue with")
|
|
552
560
|
})
|
|
553
561
|
})]
|
|
554
562
|
}),
|
|
555
|
-
|
|
563
|
+
Le && /* @__PURE__ */ g("div", {
|
|
556
564
|
className: "flex items-start gap-3 p-4 rounded-xl border bg-status-error-bg-subtle border-status-error-border",
|
|
557
|
-
children: [/* @__PURE__ */ h(
|
|
565
|
+
children: [/* @__PURE__ */ h(o, { className: "size-5 flex-shrink-0 mt-0.5 text-status-error-text" }), /* @__PURE__ */ h("p", {
|
|
558
566
|
className: "text-sm text-status-error-text",
|
|
559
|
-
children:
|
|
567
|
+
children: Le
|
|
560
568
|
})]
|
|
561
569
|
}),
|
|
562
570
|
/* @__PURE__ */ h("div", {
|
|
563
571
|
className: "grid grid-cols-3 gap-3",
|
|
564
|
-
children:
|
|
572
|
+
children: Je.map((e) => /* @__PURE__ */ g("button", {
|
|
565
573
|
type: "button",
|
|
566
574
|
onClick: e.onClick,
|
|
567
575
|
disabled: e.disabled,
|
|
@@ -578,14 +586,14 @@ function x() {
|
|
|
578
586
|
className: "mt-4 text-center",
|
|
579
587
|
children: /* @__PURE__ */ g("button", {
|
|
580
588
|
type: "button",
|
|
581
|
-
onClick: () =>
|
|
589
|
+
onClick: () => y("/auth/magic-link"),
|
|
582
590
|
className: "text-sm text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] transition-colors",
|
|
583
591
|
children: [
|
|
584
|
-
|
|
592
|
+
S("auth.login.preferPasswordless", "Prefer passwordless login?"),
|
|
585
593
|
" ",
|
|
586
594
|
/* @__PURE__ */ h("span", {
|
|
587
595
|
className: "font-semibold text-text-link hover:text-text-linkHover",
|
|
588
|
-
children:
|
|
596
|
+
children: S("auth.login.signInMagicLink", "Sign in with Magic Link")
|
|
589
597
|
})
|
|
590
598
|
]
|
|
591
599
|
})
|
|
@@ -593,13 +601,13 @@ function x() {
|
|
|
593
601
|
/* @__PURE__ */ g("p", {
|
|
594
602
|
className: "mt-6 text-center text-sm text-[var(--color-text-secondary)]",
|
|
595
603
|
children: [
|
|
596
|
-
|
|
604
|
+
S("auth.login.dontHaveAccount", "Don't have an account?"),
|
|
597
605
|
" ",
|
|
598
606
|
/* @__PURE__ */ h("button", {
|
|
599
607
|
type: "button",
|
|
600
|
-
onClick: () =>
|
|
608
|
+
onClick: () => y("/auth/register"),
|
|
601
609
|
className: "font-semibold text-text-link hover:text-text-linkHover transition-colors",
|
|
602
|
-
children:
|
|
610
|
+
children: S("auth.login.signUp", "Sign up")
|
|
603
611
|
})
|
|
604
612
|
]
|
|
605
613
|
})
|
|
@@ -607,6 +615,6 @@ function x() {
|
|
|
607
615
|
});
|
|
608
616
|
}
|
|
609
617
|
//#endregion
|
|
610
|
-
export {
|
|
618
|
+
export { b as LoginPage };
|
|
611
619
|
|
|
612
620
|
//# sourceMappingURL=LoginPage.js.map
|