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