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