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