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