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