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