@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,439 @@
|
|
|
1
|
+
import { useAuth as e } from "../providers/AuthProvider.js";
|
|
2
|
+
import { useAuthOperations as t } from "../hooks/useAuthOperations.js";
|
|
3
|
+
import { useOAuthOperations as n } from "../hooks/useOAuthOperations.js";
|
|
4
|
+
import { AuthLayout as r } from "../components/AuthLayout.js";
|
|
5
|
+
import { AlertIcon as i, CheckIcon as a, EmailIcon as o, EyeIcon as ee, EyeOffIcon as s, GitHubIcon as c, GoogleIcon as l, LockIcon as u, MicrosoftIcon as d, SpinnerIcon as f, UserIcon as p, XIcon as m } from "../components/AuthIcons.js";
|
|
6
|
+
import { validateEmail as h, validatePassword as g } from "../utils/validation.js";
|
|
7
|
+
import { CaptchaV2 as _, isCaptchaEnabled as v } from "../components/CaptchaV2.js";
|
|
8
|
+
import { useState as y } from "react";
|
|
9
|
+
import { useNavigate as b } from "react-router-dom";
|
|
10
|
+
import { useI18n as x } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
11
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
12
|
+
//#region src/auth/pages/RegisterPage.tsx
|
|
13
|
+
function T() {
|
|
14
|
+
let { productName: T } = e(), E = b(), { t: te } = x(), D = (e, t) => {
|
|
15
|
+
let n = te(e);
|
|
16
|
+
return n === e ? t : n;
|
|
17
|
+
}, { signUp: O, isLoading: k } = t(), { initiateGoogleOAuth: A, initiateMicrosoftOAuth: j, isProviderConfigured: M } = n(), [N, P] = y(!1), [F, I] = y({
|
|
18
|
+
email: "",
|
|
19
|
+
username: "",
|
|
20
|
+
password: "",
|
|
21
|
+
firstName: "",
|
|
22
|
+
lastName: ""
|
|
23
|
+
}), [L, R] = y([]), [z, B] = y(!1), [V, H] = y(null), [U, W] = y(null), [G, K] = y(null), q = (() => {
|
|
24
|
+
let e = F.password;
|
|
25
|
+
return [
|
|
26
|
+
{
|
|
27
|
+
label: D("auth.register.pwMin8", "At least 8 characters"),
|
|
28
|
+
met: e.length >= 8
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: D("auth.register.pwUppercase", "One uppercase letter"),
|
|
32
|
+
met: /[A-Z]/.test(e)
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: D("auth.register.pwLowercase", "One lowercase letter"),
|
|
36
|
+
met: /[a-z]/.test(e)
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: D("auth.register.pwNumber", "One number"),
|
|
40
|
+
met: /\d/.test(e)
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: D("auth.register.pwSpecial", "One special character"),
|
|
44
|
+
met: /[!@#$%^&*(),.?":{}|<>]/.test(e)
|
|
45
|
+
}
|
|
46
|
+
];
|
|
47
|
+
})(), J = (() => {
|
|
48
|
+
let e = q.filter((e) => e.met).length;
|
|
49
|
+
return e <= 2 ? {
|
|
50
|
+
level: D("auth.register.passwordStrengthWeak", "weak"),
|
|
51
|
+
color: "bg-status-error-bg-subtle0",
|
|
52
|
+
width: "w-1/4"
|
|
53
|
+
} : e <= 3 ? {
|
|
54
|
+
level: D("auth.register.passwordStrengthFair", "fair"),
|
|
55
|
+
color: "bg-orange-500",
|
|
56
|
+
width: "w-2/4"
|
|
57
|
+
} : e <= 4 ? {
|
|
58
|
+
level: D("auth.register.passwordStrengthGood", "good"),
|
|
59
|
+
color: "bg-status-warning-bg-subtle0",
|
|
60
|
+
width: "w-3/4"
|
|
61
|
+
} : {
|
|
62
|
+
level: D("auth.register.passwordStrengthStrong", "strong"),
|
|
63
|
+
color: "bg-status-success-text",
|
|
64
|
+
width: "w-full"
|
|
65
|
+
};
|
|
66
|
+
})(), Y = async (e) => {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
let t = [];
|
|
69
|
+
h(F.email) || t.push(D("auth.register.invalidEmail", "Please enter a valid email address")), (!F.username || F.username.length < 3) && t.push(D("auth.register.usernameMin3", "Username must be at least 3 characters")), /^[a-zA-Z0-9_-]+$/.test(F.username) || t.push(D("auth.register.usernameChars", "Username can only contain letters, numbers, underscores, and hyphens"));
|
|
70
|
+
let n = g(F.password);
|
|
71
|
+
if (n.valid || t.push(...n.errors), v() && !G && t.push(D("auth.register.completeCaptcha", "Please complete the reCAPTCHA verification")), t.length > 0) {
|
|
72
|
+
R(t);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
R([]), H(null);
|
|
76
|
+
try {
|
|
77
|
+
await O({
|
|
78
|
+
...F,
|
|
79
|
+
...G ? { recaptchaToken: G } : {}
|
|
80
|
+
}), B(!0);
|
|
81
|
+
} catch (e) {
|
|
82
|
+
H(e instanceof Error ? e.message : D("auth.register.signUpFailed", "Sign up failed")), console.error("Sign up failed:", e);
|
|
83
|
+
}
|
|
84
|
+
}, X = () => {
|
|
85
|
+
W(null);
|
|
86
|
+
try {
|
|
87
|
+
A();
|
|
88
|
+
} catch (e) {
|
|
89
|
+
W(e instanceof Error ? e.message : D("auth.register.googleSignUpFailed", "Failed to initiate Google sign up"));
|
|
90
|
+
}
|
|
91
|
+
}, Z = () => {
|
|
92
|
+
W(null);
|
|
93
|
+
try {
|
|
94
|
+
j();
|
|
95
|
+
} catch (e) {
|
|
96
|
+
W(e instanceof Error ? e.message : D("auth.register.microsoftSignUpFailed", "Failed to initiate Microsoft sign up"));
|
|
97
|
+
}
|
|
98
|
+
}, Q = M("google"), $ = M("microsoft"), ne = [
|
|
99
|
+
{
|
|
100
|
+
name: "Google",
|
|
101
|
+
icon: l,
|
|
102
|
+
onClick: X,
|
|
103
|
+
disabled: !Q,
|
|
104
|
+
tooltip: Q ? void 0 : D("auth.register.googleNotConfigured", "Google sign up is not configured")
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: "GitHub",
|
|
108
|
+
icon: c,
|
|
109
|
+
onClick: () => {},
|
|
110
|
+
disabled: !0,
|
|
111
|
+
tooltip: D("auth.register.githubNotConfigured", "GitHub sign up is not configured")
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: "Microsoft",
|
|
115
|
+
icon: d,
|
|
116
|
+
onClick: Z,
|
|
117
|
+
disabled: !$,
|
|
118
|
+
tooltip: $ ? void 0 : D("auth.register.microsoftNotConfigured", "Microsoft sign up is not configured")
|
|
119
|
+
}
|
|
120
|
+
], [re, ie = ""] = D("auth.register.verificationEmailSentTo", "We've sent a verification email to {{email}}. Please check your inbox and click the verification link to activate your account.").split("{{email}}");
|
|
121
|
+
return z ? /* @__PURE__ */ C(r, {
|
|
122
|
+
title: D("auth.register.checkEmail", "Check your email"),
|
|
123
|
+
subtitle: D("auth.register.verificationLinkSent", "We've sent you a verification link"),
|
|
124
|
+
children: /* @__PURE__ */ w("div", {
|
|
125
|
+
className: "flex flex-col items-center justify-center py-6",
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ C("div", {
|
|
128
|
+
className: "w-20 h-20 rounded-full bg-status-success-bg-subtle flex items-center justify-center mb-6",
|
|
129
|
+
children: /* @__PURE__ */ C("svg", {
|
|
130
|
+
className: "w-10 h-10 text-status-success-text",
|
|
131
|
+
fill: "none",
|
|
132
|
+
viewBox: "0 0 24 24",
|
|
133
|
+
stroke: "currentColor",
|
|
134
|
+
children: /* @__PURE__ */ C("path", {
|
|
135
|
+
strokeLinecap: "round",
|
|
136
|
+
strokeLinejoin: "round",
|
|
137
|
+
strokeWidth: 2,
|
|
138
|
+
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"
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
}),
|
|
142
|
+
/* @__PURE__ */ C("h3", {
|
|
143
|
+
className: "text-lg font-semibold text-[var(--color-text-primary)] mb-2",
|
|
144
|
+
children: D("auth.register.accountCreated", "Account created successfully!")
|
|
145
|
+
}),
|
|
146
|
+
/* @__PURE__ */ w("p", {
|
|
147
|
+
className: "text-center text-[var(--color-text-secondary)] mb-8 max-w-sm",
|
|
148
|
+
children: [
|
|
149
|
+
re,
|
|
150
|
+
/* @__PURE__ */ C("span", {
|
|
151
|
+
className: "font-medium text-[var(--color-text-primary)]",
|
|
152
|
+
children: F.email
|
|
153
|
+
}),
|
|
154
|
+
ie
|
|
155
|
+
]
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ w("div", {
|
|
158
|
+
className: "space-y-3 w-full",
|
|
159
|
+
children: [/* @__PURE__ */ C("button", {
|
|
160
|
+
onClick: () => E("/auth/login"),
|
|
161
|
+
className: "auth-primary-button w-full px-4 py-3 font-semibold",
|
|
162
|
+
children: D("auth.register.continueToSignIn", "Continue to sign in")
|
|
163
|
+
}), /* @__PURE__ */ w("p", {
|
|
164
|
+
className: "text-center text-sm text-[var(--color-text-tertiary)]",
|
|
165
|
+
children: [
|
|
166
|
+
D("auth.register.didntReceiveEmail", "Didn't receive the email? Check your spam folder or"),
|
|
167
|
+
" ",
|
|
168
|
+
/* @__PURE__ */ C("button", {
|
|
169
|
+
onClick: () => B(!1),
|
|
170
|
+
className: "text-text-link hover:text-text-linkHover font-medium",
|
|
171
|
+
children: D("auth.register.tryAgain", "try again")
|
|
172
|
+
})
|
|
173
|
+
]
|
|
174
|
+
})]
|
|
175
|
+
})
|
|
176
|
+
]
|
|
177
|
+
})
|
|
178
|
+
}) : /* @__PURE__ */ w(r, {
|
|
179
|
+
title: D("auth.register.createAccount", "Create your account"),
|
|
180
|
+
subtitle: D("auth.register.startJourney", "Start your journey with {{productName}}").replace("{{productName}}", T || "Burdenoff Workspaces"),
|
|
181
|
+
productName: T,
|
|
182
|
+
children: [
|
|
183
|
+
/* @__PURE__ */ w("form", {
|
|
184
|
+
onSubmit: Y,
|
|
185
|
+
className: "space-y-5",
|
|
186
|
+
children: [
|
|
187
|
+
(V || L.length > 0) && /* @__PURE__ */ w("div", {
|
|
188
|
+
className: "flex items-start gap-3 p-4 rounded-xl bg-status-error-bg-subtle border border-status-error-border",
|
|
189
|
+
children: [/* @__PURE__ */ C(i, { className: "w-5 h-5 text-status-error-text flex-shrink-0 mt-0.5" }), /* @__PURE__ */ w("div", {
|
|
190
|
+
className: "space-y-1",
|
|
191
|
+
children: [V && /* @__PURE__ */ C("p", {
|
|
192
|
+
className: "text-sm text-status-error-text",
|
|
193
|
+
children: V
|
|
194
|
+
}), L.map((e, t) => /* @__PURE__ */ C("p", {
|
|
195
|
+
className: "text-sm text-status-error-text",
|
|
196
|
+
children: e
|
|
197
|
+
}, t))]
|
|
198
|
+
})]
|
|
199
|
+
}),
|
|
200
|
+
/* @__PURE__ */ w("div", {
|
|
201
|
+
className: "grid grid-cols-2 gap-4",
|
|
202
|
+
children: [/* @__PURE__ */ w("div", {
|
|
203
|
+
className: "space-y-2",
|
|
204
|
+
children: [/* @__PURE__ */ C("label", {
|
|
205
|
+
htmlFor: "firstName",
|
|
206
|
+
className: "block text-sm font-medium text-[var(--color-text-primary)]",
|
|
207
|
+
children: D("auth.register.firstName", "First Name")
|
|
208
|
+
}), /* @__PURE__ */ C("input", {
|
|
209
|
+
id: "firstName",
|
|
210
|
+
type: "text",
|
|
211
|
+
required: !0,
|
|
212
|
+
value: F.firstName,
|
|
213
|
+
onChange: (e) => I({
|
|
214
|
+
...F,
|
|
215
|
+
firstName: e.target.value
|
|
216
|
+
}),
|
|
217
|
+
className: "block w-full px-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",
|
|
218
|
+
placeholder: D("auth.register.firstNamePlaceholder", "Enter first name")
|
|
219
|
+
})]
|
|
220
|
+
}), /* @__PURE__ */ w("div", {
|
|
221
|
+
className: "space-y-2",
|
|
222
|
+
children: [/* @__PURE__ */ C("label", {
|
|
223
|
+
htmlFor: "lastName",
|
|
224
|
+
className: "block text-sm font-medium text-[var(--color-text-primary)]",
|
|
225
|
+
children: D("auth.register.lastName", "Last Name")
|
|
226
|
+
}), /* @__PURE__ */ C("input", {
|
|
227
|
+
id: "lastName",
|
|
228
|
+
type: "text",
|
|
229
|
+
required: !0,
|
|
230
|
+
value: F.lastName,
|
|
231
|
+
onChange: (e) => I({
|
|
232
|
+
...F,
|
|
233
|
+
lastName: e.target.value
|
|
234
|
+
}),
|
|
235
|
+
className: "block w-full px-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",
|
|
236
|
+
placeholder: D("auth.register.lastNamePlaceholder", "Enter last name")
|
|
237
|
+
})]
|
|
238
|
+
})]
|
|
239
|
+
}),
|
|
240
|
+
/* @__PURE__ */ w("div", {
|
|
241
|
+
className: "space-y-2",
|
|
242
|
+
children: [/* @__PURE__ */ C("label", {
|
|
243
|
+
htmlFor: "username",
|
|
244
|
+
className: "block text-sm font-medium text-[var(--color-text-primary)]",
|
|
245
|
+
children: D("auth.register.username", "Username")
|
|
246
|
+
}), /* @__PURE__ */ w("div", {
|
|
247
|
+
className: "relative",
|
|
248
|
+
children: [/* @__PURE__ */ C("div", {
|
|
249
|
+
className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
|
|
250
|
+
children: /* @__PURE__ */ C(p, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" })
|
|
251
|
+
}), /* @__PURE__ */ C("input", {
|
|
252
|
+
id: "username",
|
|
253
|
+
type: "text",
|
|
254
|
+
required: !0,
|
|
255
|
+
value: F.username,
|
|
256
|
+
onChange: (e) => I({
|
|
257
|
+
...F,
|
|
258
|
+
username: e.target.value
|
|
259
|
+
}),
|
|
260
|
+
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",
|
|
261
|
+
placeholder: D("auth.register.usernamePlaceholder", "Choose a username")
|
|
262
|
+
})]
|
|
263
|
+
})]
|
|
264
|
+
}),
|
|
265
|
+
/* @__PURE__ */ w("div", {
|
|
266
|
+
className: "space-y-2",
|
|
267
|
+
children: [/* @__PURE__ */ C("label", {
|
|
268
|
+
htmlFor: "email",
|
|
269
|
+
className: "block text-sm font-medium text-[var(--color-text-primary)]",
|
|
270
|
+
children: D("auth.register.email", "Email")
|
|
271
|
+
}), /* @__PURE__ */ w("div", {
|
|
272
|
+
className: "relative",
|
|
273
|
+
children: [/* @__PURE__ */ C("div", {
|
|
274
|
+
className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
|
|
275
|
+
children: /* @__PURE__ */ C(o, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" })
|
|
276
|
+
}), /* @__PURE__ */ C("input", {
|
|
277
|
+
id: "email",
|
|
278
|
+
type: "email",
|
|
279
|
+
required: !0,
|
|
280
|
+
value: F.email,
|
|
281
|
+
onChange: (e) => I({
|
|
282
|
+
...F,
|
|
283
|
+
email: e.target.value
|
|
284
|
+
}),
|
|
285
|
+
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",
|
|
286
|
+
placeholder: D("auth.register.emailPlaceholder", "you@example.com")
|
|
287
|
+
})]
|
|
288
|
+
})]
|
|
289
|
+
}),
|
|
290
|
+
/* @__PURE__ */ w("div", {
|
|
291
|
+
className: "space-y-2",
|
|
292
|
+
children: [
|
|
293
|
+
/* @__PURE__ */ C("label", {
|
|
294
|
+
htmlFor: "password",
|
|
295
|
+
className: "block text-sm font-medium text-[var(--color-text-primary)]",
|
|
296
|
+
children: D("auth.register.password", "Password")
|
|
297
|
+
}),
|
|
298
|
+
/* @__PURE__ */ w("div", {
|
|
299
|
+
className: "relative",
|
|
300
|
+
children: [
|
|
301
|
+
/* @__PURE__ */ C("div", {
|
|
302
|
+
className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
|
|
303
|
+
children: /* @__PURE__ */ C(u, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" })
|
|
304
|
+
}),
|
|
305
|
+
/* @__PURE__ */ C("input", {
|
|
306
|
+
id: "password",
|
|
307
|
+
type: N ? "text" : "password",
|
|
308
|
+
required: !0,
|
|
309
|
+
value: F.password,
|
|
310
|
+
onChange: (e) => I({
|
|
311
|
+
...F,
|
|
312
|
+
password: e.target.value
|
|
313
|
+
}),
|
|
314
|
+
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",
|
|
315
|
+
placeholder: D("auth.register.passwordPlaceholder", "Create a strong password")
|
|
316
|
+
}),
|
|
317
|
+
/* @__PURE__ */ C("button", {
|
|
318
|
+
type: "button",
|
|
319
|
+
onClick: () => P(!N),
|
|
320
|
+
"aria-label": N ? "Hide password" : "Show password",
|
|
321
|
+
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",
|
|
322
|
+
children: C(N ? s : ee, { className: "w-5 h-5" })
|
|
323
|
+
})
|
|
324
|
+
]
|
|
325
|
+
}),
|
|
326
|
+
F.password && /* @__PURE__ */ w("div", {
|
|
327
|
+
className: "space-y-3 pt-2",
|
|
328
|
+
children: [/* @__PURE__ */ w("div", {
|
|
329
|
+
className: "space-y-1",
|
|
330
|
+
children: [/* @__PURE__ */ C("div", {
|
|
331
|
+
className: "h-1.5 bg-[var(--color-bg-sunken)] rounded-full overflow-hidden",
|
|
332
|
+
children: /* @__PURE__ */ C("div", { className: `h-full ${J.color} ${J.width} transition-all duration-300` })
|
|
333
|
+
}), /* @__PURE__ */ w("p", {
|
|
334
|
+
className: "text-xs text-[var(--color-text-tertiary)] capitalize",
|
|
335
|
+
children: [
|
|
336
|
+
D("auth.register.passwordStrength", "Password strength:"),
|
|
337
|
+
" ",
|
|
338
|
+
/* @__PURE__ */ C("span", {
|
|
339
|
+
className: "font-medium",
|
|
340
|
+
children: J.level
|
|
341
|
+
})
|
|
342
|
+
]
|
|
343
|
+
})]
|
|
344
|
+
}), /* @__PURE__ */ C("div", {
|
|
345
|
+
className: "grid grid-cols-2 gap-2",
|
|
346
|
+
children: q.map((e, t) => /* @__PURE__ */ w("div", {
|
|
347
|
+
className: "flex items-center gap-2",
|
|
348
|
+
children: [e.met ? /* @__PURE__ */ C(a, { className: "w-4 h-4 text-status-success-text" }) : /* @__PURE__ */ C(m, { className: "w-4 h-4 text-[var(--color-text-tertiary)]" }), /* @__PURE__ */ C("span", {
|
|
349
|
+
className: `text-xs ${e.met ? "text-status-success-text" : "text-[var(--color-text-tertiary)]"}`,
|
|
350
|
+
children: e.label
|
|
351
|
+
})]
|
|
352
|
+
}, t))
|
|
353
|
+
})]
|
|
354
|
+
})
|
|
355
|
+
]
|
|
356
|
+
}),
|
|
357
|
+
/* @__PURE__ */ w("p", {
|
|
358
|
+
className: "text-xs text-[var(--color-text-tertiary)] leading-relaxed",
|
|
359
|
+
children: [
|
|
360
|
+
D("auth.register.agreeToTerms", "By creating an account, you agree to our"),
|
|
361
|
+
" ",
|
|
362
|
+
/* @__PURE__ */ C("a", {
|
|
363
|
+
href: "/legal/terms",
|
|
364
|
+
className: "text-text-link hover:underline",
|
|
365
|
+
children: D("auth.register.termsOfService", "Terms of Service")
|
|
366
|
+
}),
|
|
367
|
+
" ",
|
|
368
|
+
D("auth.register.and", "and"),
|
|
369
|
+
" ",
|
|
370
|
+
/* @__PURE__ */ C("a", {
|
|
371
|
+
href: "/legal/privacy",
|
|
372
|
+
className: "text-text-link hover:underline",
|
|
373
|
+
children: D("auth.register.privacyPolicy", "Privacy Policy")
|
|
374
|
+
}),
|
|
375
|
+
"."
|
|
376
|
+
]
|
|
377
|
+
}),
|
|
378
|
+
/* @__PURE__ */ C(_, { onVerify: K }),
|
|
379
|
+
/* @__PURE__ */ C("button", {
|
|
380
|
+
type: "submit",
|
|
381
|
+
disabled: k,
|
|
382
|
+
className: "auth-primary-button flex w-full items-center justify-center gap-2 px-4 py-3 font-semibold",
|
|
383
|
+
children: k ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(f, { className: "w-5 h-5 animate-spin" }), /* @__PURE__ */ C("span", { children: D("auth.register.creatingAccount", "Creating account...") })] }) : D("auth.register.createAccountBtn", "Create account")
|
|
384
|
+
})
|
|
385
|
+
]
|
|
386
|
+
}),
|
|
387
|
+
/* @__PURE__ */ w("div", {
|
|
388
|
+
className: "relative my-8",
|
|
389
|
+
children: [/* @__PURE__ */ C("div", {
|
|
390
|
+
className: "absolute inset-0 flex items-center",
|
|
391
|
+
children: /* @__PURE__ */ C("div", { className: "w-full border-t border-[var(--color-border-default)]" })
|
|
392
|
+
}), /* @__PURE__ */ C("div", {
|
|
393
|
+
className: "relative flex justify-center",
|
|
394
|
+
children: /* @__PURE__ */ C("span", {
|
|
395
|
+
className: "px-4 bg-[var(--color-bg-canvas)] text-sm text-[var(--color-text-tertiary)]",
|
|
396
|
+
children: D("auth.register.orSignUpWith", "or sign up with")
|
|
397
|
+
})
|
|
398
|
+
})]
|
|
399
|
+
}),
|
|
400
|
+
U && /* @__PURE__ */ w("div", {
|
|
401
|
+
className: "flex items-start gap-3 p-4 rounded-xl border bg-status-error-bg-subtle border-status-error-border",
|
|
402
|
+
children: [/* @__PURE__ */ C(i, { className: "w-5 h-5 flex-shrink-0 mt-0.5 text-status-error-text" }), /* @__PURE__ */ C("p", {
|
|
403
|
+
className: "text-sm text-status-error-text",
|
|
404
|
+
children: U
|
|
405
|
+
})]
|
|
406
|
+
}),
|
|
407
|
+
/* @__PURE__ */ C("div", {
|
|
408
|
+
className: "grid grid-cols-3 gap-3",
|
|
409
|
+
children: ne.map((e) => /* @__PURE__ */ w("button", {
|
|
410
|
+
type: "button",
|
|
411
|
+
onClick: e.onClick,
|
|
412
|
+
disabled: e.disabled,
|
|
413
|
+
title: e.tooltip,
|
|
414
|
+
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)]"}`,
|
|
415
|
+
children: [/* @__PURE__ */ C(e.icon, { className: `w-5 h-5 ${e.disabled ? "opacity-50" : ""}` }), /* @__PURE__ */ C("span", {
|
|
416
|
+
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)]"}`,
|
|
417
|
+
children: e.name
|
|
418
|
+
})]
|
|
419
|
+
}, e.name))
|
|
420
|
+
}),
|
|
421
|
+
/* @__PURE__ */ w("p", {
|
|
422
|
+
className: "mt-8 text-center text-sm text-[var(--color-text-secondary)]",
|
|
423
|
+
children: [
|
|
424
|
+
D("auth.register.alreadyHaveAccount", "Already have an account?"),
|
|
425
|
+
" ",
|
|
426
|
+
/* @__PURE__ */ C("button", {
|
|
427
|
+
onClick: () => E("/auth/login"),
|
|
428
|
+
className: "font-semibold text-text-link hover:text-text-linkHover transition-colors",
|
|
429
|
+
children: D("auth.register.signIn", "Sign in")
|
|
430
|
+
})
|
|
431
|
+
]
|
|
432
|
+
})
|
|
433
|
+
]
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
//#endregion
|
|
437
|
+
export { T as RegisterPage };
|
|
438
|
+
|
|
439
|
+
//# sourceMappingURL=RegisterPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RegisterPage.js","names":[],"sources":["../../../src/auth/pages/RegisterPage.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\nimport { useI18n } from \"@burdenoff/fe-libs/shared/providers/shell\";\nimport { validateEmail, validatePassword } from \"../utils\";\nimport { useAuthOperations } from \"../hooks/useAuthOperations\";\nimport { useOAuthOperations } from \"../hooks/useOAuthOperations\";\nimport { AuthLayout } from \"../components/AuthLayout\";\nimport {\n EmailIcon,\n LockIcon,\n UserIcon,\n EyeIcon,\n EyeOffIcon,\n AlertIcon,\n CheckIcon,\n XIcon,\n SpinnerIcon,\n GoogleIcon,\n GitHubIcon,\n MicrosoftIcon,\n} from \"../components/AuthIcons\";\nimport { useAuth } from \"../providers/AuthProvider\";\nimport { CaptchaV2, isCaptchaEnabled } from \"../components/CaptchaV2\";\nimport type { SignUpInput } from \"../types\";\n\n/**\n * Registration page with professional design\n */\nexport function RegisterPage() {\n const { productName } = useAuth();\n const navigate = useNavigate();\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n const { signUp, isLoading } = useAuthOperations();\n const { initiateGoogleOAuth, initiateMicrosoftOAuth, isProviderConfigured } =\n useOAuthOperations();\n const [showPassword, setShowPassword] = useState(false);\n const [formData, setFormData] = useState<SignUpInput>({\n email: \"\",\n username: \"\",\n password: \"\",\n firstName: \"\",\n lastName: \"\",\n });\n const [validationErrors, setValidationErrors] = useState<string[]>([]);\n const [signupSuccess, setSignupSuccess] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [oauthError, setOauthError] = useState<string | null>(null);\n const [captchaToken, setCaptchaToken] = useState<string | null>(null);\n\n // Password strength indicators\n const passwordChecks = (() => {\n const password = formData.password;\n return [\n {\n label: tr(\"auth.register.pwMin8\", \"At least 8 characters\"),\n met: password.length >= 8,\n },\n {\n label: tr(\"auth.register.pwUppercase\", \"One uppercase letter\"),\n met: /[A-Z]/.test(password),\n },\n {\n label: tr(\"auth.register.pwLowercase\", \"One lowercase letter\"),\n met: /[a-z]/.test(password),\n },\n {\n label: tr(\"auth.register.pwNumber\", \"One number\"),\n met: /\\d/.test(password),\n },\n {\n label: tr(\"auth.register.pwSpecial\", \"One special character\"),\n met: /[!@#$%^&*(),.?\":{}|<>]/.test(password),\n },\n ];\n })();\n\n const passwordStrength = (() => {\n const metCount = passwordChecks.filter((c) => c.met).length;\n if (metCount <= 2)\n return {\n level: tr(\"auth.register.passwordStrengthWeak\", \"weak\"),\n color: \"bg-status-error-bg-subtle0\",\n width: \"w-1/4\",\n };\n if (metCount <= 3)\n return {\n level: tr(\"auth.register.passwordStrengthFair\", \"fair\"),\n color: \"bg-orange-500\",\n width: \"w-2/4\",\n };\n if (metCount <= 4)\n return {\n level: tr(\"auth.register.passwordStrengthGood\", \"good\"),\n color: \"bg-status-warning-bg-subtle0\",\n width: \"w-3/4\",\n };\n return {\n level: tr(\"auth.register.passwordStrengthStrong\", \"strong\"),\n color: \"bg-status-success-text\",\n width: \"w-full\",\n };\n })();\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n\n const errors: string[] = [];\n if (!validateEmail(formData.email)) {\n errors.push(\n tr(\"auth.register.invalidEmail\", \"Please enter a valid email address\"),\n );\n }\n if (!formData.username || formData.username.length < 3) {\n errors.push(\n tr(\n \"auth.register.usernameMin3\",\n \"Username must be at least 3 characters\",\n ),\n );\n }\n if (!/^[a-zA-Z0-9_-]+$/.test(formData.username)) {\n errors.push(\n tr(\n \"auth.register.usernameChars\",\n \"Username can only contain letters, numbers, underscores, and hyphens\",\n ),\n );\n }\n const passwordValidation = validatePassword(formData.password);\n if (!passwordValidation.valid) {\n errors.push(...passwordValidation.errors);\n }\n\n if (isCaptchaEnabled() && !captchaToken) {\n errors.push(\n tr(\n \"auth.register.completeCaptcha\",\n \"Please complete the reCAPTCHA verification\",\n ),\n );\n }\n\n if (errors.length > 0) {\n setValidationErrors(errors);\n return;\n }\n\n setValidationErrors([]);\n setError(null);\n try {\n await signUp({\n ...formData,\n ...(captchaToken ? { recaptchaToken: captchaToken } : {}),\n });\n // Sign up successful - check if email verification is required\n // (Backend returns empty tokens when email verification is needed)\n setSignupSuccess(true);\n } catch (err) {\n const message =\n err instanceof Error\n ? err.message\n : tr(\"auth.register.signUpFailed\", \"Sign up failed\");\n setError(message);\n console.error(\"Sign up failed:\", err);\n }\n };\n\n /**\n * Handle Google OAuth signup\n */\n const handleGoogleSignup = () => {\n setOauthError(null);\n try {\n initiateGoogleOAuth();\n } catch (err) {\n setOauthError(\n err instanceof Error\n ? err.message\n : tr(\n \"auth.register.googleSignUpFailed\",\n \"Failed to initiate Google sign up\",\n ),\n );\n }\n };\n\n /**\n * Handle Microsoft OAuth signup\n */\n const handleMicrosoftSignup = () => {\n setOauthError(null);\n try {\n initiateMicrosoftOAuth();\n } catch (err) {\n setOauthError(\n err instanceof Error\n ? err.message\n : tr(\n \"auth.register.microsoftSignUpFailed\",\n \"Failed to initiate Microsoft sign up\",\n ),\n );\n }\n };\n\n // Check if OAuth providers are configured\n const isGoogleConfigured = isProviderConfigured(\"google\");\n const isMicrosoftConfigured = isProviderConfigured(\"microsoft\");\n\n const oauthProviders = [\n {\n name: \"Google\",\n icon: GoogleIcon,\n onClick: handleGoogleSignup,\n disabled: !isGoogleConfigured,\n tooltip: isGoogleConfigured\n ? undefined\n : tr(\n \"auth.register.googleNotConfigured\",\n \"Google sign up is not configured\",\n ),\n },\n {\n name: \"GitHub\",\n icon: GitHubIcon,\n onClick: () => {},\n disabled: true,\n tooltip: tr(\n \"auth.register.githubNotConfigured\",\n \"GitHub sign up is not configured\",\n ),\n },\n {\n name: \"Microsoft\",\n icon: MicrosoftIcon,\n onClick: handleMicrosoftSignup,\n disabled: !isMicrosoftConfigured,\n tooltip: isMicrosoftConfigured\n ? undefined\n : tr(\n \"auth.register.microsoftNotConfigured\",\n \"Microsoft sign up is not configured\",\n ),\n },\n ];\n\n const verificationEmailMessage = tr(\n \"auth.register.verificationEmailSentTo\",\n \"We've sent a verification email to {{email}}. Please check your inbox and click the verification link to activate your account.\",\n );\n const [verificationEmailPrefix, verificationEmailSuffix = \"\"] =\n verificationEmailMessage.split(\"{{email}}\");\n\n // Show success state after signup\n if (signupSuccess) {\n return (\n <AuthLayout\n title={tr(\"auth.register.checkEmail\", \"Check your email\")}\n subtitle={tr(\n \"auth.register.verificationLinkSent\",\n \"We've sent you a verification link\",\n )}\n >\n <div className=\"flex flex-col items-center justify-center py-6\">\n {/* Success Icon */}\n <div className=\"w-20 h-20 rounded-full bg-status-success-bg-subtle flex items-center justify-center mb-6\">\n <svg\n className=\"w-10 h-10 text-status-success-text\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n 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\"\n />\n </svg>\n </div>\n\n <h3 className=\"text-lg font-semibold text-[var(--color-text-primary)] mb-2\">\n {tr(\n \"auth.register.accountCreated\",\n \"Account created successfully!\",\n )}\n </h3>\n\n <p className=\"text-center text-[var(--color-text-secondary)] mb-8 max-w-sm\">\n {verificationEmailPrefix}\n <span className=\"font-medium text-[var(--color-text-primary)]\">\n {formData.email}\n </span>\n {verificationEmailSuffix}\n </p>\n\n <div className=\"space-y-3 w-full\">\n <button\n onClick={() => navigate(\"/auth/login\")}\n className=\"auth-primary-button w-full px-4 py-3 font-semibold\"\n >\n {tr(\"auth.register.continueToSignIn\", \"Continue to sign in\")}\n </button>\n\n <p className=\"text-center text-sm text-[var(--color-text-tertiary)]\">\n {tr(\n \"auth.register.didntReceiveEmail\",\n \"Didn't receive the email? Check your spam folder or\",\n )}{\" \"}\n <button\n onClick={() => setSignupSuccess(false)}\n className=\"text-text-link hover:text-text-linkHover font-medium\"\n >\n {tr(\"auth.register.tryAgain\", \"try again\")}\n </button>\n </p>\n </div>\n </div>\n </AuthLayout>\n );\n }\n\n return (\n <AuthLayout\n title={tr(\"auth.register.createAccount\", \"Create your account\")}\n subtitle={tr(\n \"auth.register.startJourney\",\n \"Start your journey with {{productName}}\",\n ).replace(\"{{productName}}\", productName || \"Burdenoff Workspaces\")}\n productName={productName}\n >\n <form onSubmit={handleSubmit} className=\"space-y-5\">\n {/* Error Alert */}\n {(error || validationErrors.length > 0) && (\n <div className=\"flex items-start gap-3 p-4 rounded-xl bg-status-error-bg-subtle border border-status-error-border\">\n <AlertIcon className=\"w-5 h-5 text-status-error-text flex-shrink-0 mt-0.5\" />\n <div className=\"space-y-1\">\n {error && (\n <p className=\"text-sm text-status-error-text\">{error}</p>\n )}\n {validationErrors.map((err, i) => (\n <p key={i} className=\"text-sm text-status-error-text\">\n {err}\n </p>\n ))}\n </div>\n </div>\n )}\n\n {/* Name Fields */}\n <div className=\"grid grid-cols-2 gap-4\">\n <div className=\"space-y-2\">\n <label\n htmlFor=\"firstName\"\n className=\"block text-sm font-medium text-[var(--color-text-primary)]\"\n >\n {tr(\"auth.register.firstName\", \"First Name\")}\n </label>\n <input\n id=\"firstName\"\n type=\"text\"\n required\n value={formData.firstName}\n onChange={(e) =>\n setFormData({ ...formData, firstName: e.target.value })\n }\n className=\"block w-full px-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\"\n placeholder={tr(\n \"auth.register.firstNamePlaceholder\",\n \"Enter first name\",\n )}\n />\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor=\"lastName\"\n className=\"block text-sm font-medium text-[var(--color-text-primary)]\"\n >\n {tr(\"auth.register.lastName\", \"Last Name\")}\n </label>\n <input\n id=\"lastName\"\n type=\"text\"\n required\n value={formData.lastName}\n onChange={(e) =>\n setFormData({ ...formData, lastName: e.target.value })\n }\n className=\"block w-full px-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\"\n placeholder={tr(\n \"auth.register.lastNamePlaceholder\",\n \"Enter last name\",\n )}\n />\n </div>\n </div>\n\n {/* Username Input */}\n <div className=\"space-y-2\">\n <label\n htmlFor=\"username\"\n className=\"block text-sm font-medium text-[var(--color-text-primary)]\"\n >\n {tr(\"auth.register.username\", \"Username\")}\n </label>\n <div className=\"relative\">\n <div className=\"absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none\">\n <UserIcon className=\"w-5 h-5 text-[var(--color-text-tertiary)]\" />\n </div>\n <input\n id=\"username\"\n type=\"text\"\n required\n value={formData.username}\n onChange={(e) =>\n setFormData({ ...formData, username: e.target.value })\n }\n 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\"\n placeholder={tr(\n \"auth.register.usernamePlaceholder\",\n \"Choose a username\",\n )}\n />\n </div>\n </div>\n\n {/* Email Input */}\n <div className=\"space-y-2\">\n <label\n htmlFor=\"email\"\n className=\"block text-sm font-medium text-[var(--color-text-primary)]\"\n >\n {tr(\"auth.register.email\", \"Email\")}\n </label>\n <div className=\"relative\">\n <div className=\"absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none\">\n <EmailIcon className=\"w-5 h-5 text-[var(--color-text-tertiary)]\" />\n </div>\n <input\n id=\"email\"\n type=\"email\"\n required\n value={formData.email}\n onChange={(e) =>\n setFormData({ ...formData, email: e.target.value })\n }\n 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\"\n placeholder={tr(\n \"auth.register.emailPlaceholder\",\n \"you@example.com\",\n )}\n />\n </div>\n </div>\n\n {/* Password Input */}\n <div className=\"space-y-2\">\n <label\n htmlFor=\"password\"\n className=\"block text-sm font-medium text-[var(--color-text-primary)]\"\n >\n {tr(\"auth.register.password\", \"Password\")}\n </label>\n <div className=\"relative\">\n <div className=\"absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none\">\n <LockIcon className=\"w-5 h-5 text-[var(--color-text-tertiary)]\" />\n </div>\n <input\n id=\"password\"\n type={showPassword ? \"text\" : \"password\"}\n required\n value={formData.password}\n onChange={(e) =>\n setFormData({ ...formData, password: e.target.value })\n }\n 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\"\n placeholder={tr(\n \"auth.register.passwordPlaceholder\",\n \"Create a strong password\",\n )}\n />\n <button\n type=\"button\"\n onClick={() => setShowPassword(!showPassword)}\n aria-label={showPassword ? \"Hide password\" : \"Show password\"}\n 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\"\n >\n {showPassword ? (\n <EyeOffIcon className=\"w-5 h-5\" />\n ) : (\n <EyeIcon className=\"w-5 h-5\" />\n )}\n </button>\n </div>\n\n {/* Password Strength Indicator */}\n {formData.password && (\n <div className=\"space-y-3 pt-2\">\n {/* Strength Bar */}\n <div className=\"space-y-1\">\n <div className=\"h-1.5 bg-[var(--color-bg-sunken)] rounded-full overflow-hidden\">\n <div\n className={`h-full ${passwordStrength.color} ${passwordStrength.width} transition-all duration-300`}\n />\n </div>\n <p className=\"text-xs text-[var(--color-text-tertiary)] capitalize\">\n {tr(\"auth.register.passwordStrength\", \"Password strength:\")}{\" \"}\n <span className=\"font-medium\">{passwordStrength.level}</span>\n </p>\n </div>\n\n {/* Requirements Checklist */}\n <div className=\"grid grid-cols-2 gap-2\">\n {passwordChecks.map((check, i) => (\n <div key={i} className=\"flex items-center gap-2\">\n {check.met ? (\n <CheckIcon className=\"w-4 h-4 text-status-success-text\" />\n ) : (\n <XIcon className=\"w-4 h-4 text-[var(--color-text-tertiary)]\" />\n )}\n <span\n className={`text-xs ${\n check.met\n ? \"text-status-success-text\"\n : \"text-[var(--color-text-tertiary)]\"\n }`}\n >\n {check.label}\n </span>\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n\n {/* Terms Agreement */}\n <p className=\"text-xs text-[var(--color-text-tertiary)] leading-relaxed\">\n {tr(\n \"auth.register.agreeToTerms\",\n \"By creating an account, you agree to our\",\n )}{\" \"}\n <a href=\"/legal/terms\" className=\"text-text-link hover:underline\">\n {tr(\"auth.register.termsOfService\", \"Terms of Service\")}\n </a>{\" \"}\n {tr(\"auth.register.and\", \"and\")}{\" \"}\n <a href=\"/legal/privacy\" className=\"text-text-link hover:underline\">\n {tr(\"auth.register.privacyPolicy\", \"Privacy Policy\")}\n </a>\n .\n </p>\n\n {/* reCAPTCHA v2 Checkbox */}\n <CaptchaV2 onVerify={setCaptchaToken} />\n\n {/* Submit Button */}\n <button\n type=\"submit\"\n disabled={isLoading}\n className=\"auth-primary-button flex w-full items-center justify-center gap-2 px-4 py-3 font-semibold\"\n >\n {isLoading ? (\n <>\n <SpinnerIcon className=\"w-5 h-5 animate-spin\" />\n <span>\n {tr(\"auth.register.creatingAccount\", \"Creating account...\")}\n </span>\n </>\n ) : (\n tr(\"auth.register.createAccountBtn\", \"Create account\")\n )}\n </button>\n </form>\n\n {/* Divider */}\n <div className=\"relative my-8\">\n <div className=\"absolute inset-0 flex items-center\">\n <div className=\"w-full border-t border-[var(--color-border-default)]\" />\n </div>\n <div className=\"relative flex justify-center\">\n <span className=\"px-4 bg-[var(--color-bg-canvas)] text-sm text-[var(--color-text-tertiary)]\">\n {tr(\"auth.register.orSignUpWith\", \"or sign up with\")}\n </span>\n </div>\n </div>\n\n {/* OAuth Error */}\n {oauthError && (\n <div className=\"flex items-start gap-3 p-4 rounded-xl border bg-status-error-bg-subtle border-status-error-border\">\n <AlertIcon className=\"w-5 h-5 flex-shrink-0 mt-0.5 text-status-error-text\" />\n <p className=\"text-sm text-status-error-text\">{oauthError}</p>\n </div>\n )}\n\n {/* OAuth Buttons */}\n <div className=\"grid grid-cols-3 gap-3\">\n {oauthProviders.map((provider) => (\n <button\n key={provider.name}\n type=\"button\"\n onClick={provider.onClick}\n disabled={provider.disabled}\n title={provider.tooltip}\n className={`flex items-center justify-center gap-2 px-4 py-3 rounded-xl border transition-all duration-200 group ${\n provider.disabled\n ? \"border-[var(--color-border-subtle)] bg-[var(--color-bg-disabled)] cursor-not-allowed opacity-50\"\n : \"border-[var(--color-border-default)] bg-[var(--color-bg-surface)] hover:bg-[var(--color-bg-sunken)] hover:border-[var(--color-border-strong)]\"\n }`}\n >\n <provider.icon\n className={`w-5 h-5 ${provider.disabled ? \"opacity-50\" : \"\"}`}\n />\n <span\n className={`sr-only sm:not-sr-only text-sm font-medium transition-colors hidden sm:inline ${\n provider.disabled\n ? \"text-[var(--color-text-disabled)]\"\n : \"text-[var(--color-text-secondary)] group-hover:text-[var(--color-text-primary)]\"\n }`}\n >\n {provider.name}\n </span>\n </button>\n ))}\n </div>\n\n {/* Sign In Link */}\n <p className=\"mt-8 text-center text-sm text-[var(--color-text-secondary)]\">\n {tr(\"auth.register.alreadyHaveAccount\", \"Already have an account?\")}{\" \"}\n <button\n onClick={() => navigate(\"/auth/login\")}\n className=\"font-semibold text-text-link hover:text-text-linkHover transition-colors\"\n >\n {tr(\"auth.register.signIn\", \"Sign in\")}\n </button>\n </p>\n </AuthLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA4BA,SAAgB,IAAe;CAC7B,IAAM,EAAE,mBAAgB,GAAS,EAC3B,IAAW,GAAa,EACxB,EAAE,UAAM,GAAS,EACjB,KAAM,GAAa,MAA6B;EACpD,IAAM,IAAa,G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,EAAG,iCAAiC,sBAAsB,EACtD,CAAA,CACN,EAAA,CAAA,GAEH,EAAG,kCAAkC,iBAAiB;MAEjD,CAAA;KACJ;;GAGP,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,OAAD,EAAK,WAAU,wDAAyD,CAAA;KACpE,CAAA,EACN,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,QAAD;MAAM,WAAU;gBACb,EAAG,8BAA8B,kBAAkB;MAC/C,CAAA;KACH,CAAA,CACF;;GAGL,KACC,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,GAAD,EAAW,WAAU,uDAAwD,CAAA,EAC7E,kBAAC,KAAD;KAAG,WAAU;eAAkC;KAAe,CAAA,CAC1D;;GAIR,kBAAC,OAAD;IAAK,WAAU;cACZ,GAAe,KAAK,MACnB,kBAAC,UAAD;KAEE,MAAK;KACL,SAAS,EAAS;KAClB,UAAU,EAAS;KACnB,OAAO,EAAS;KAChB,WAAW,wGACT,EAAS,WACL,oGACA;eATR,CAYE,kBAAC,EAAS,MAAV,EACE,WAAW,WAAW,EAAS,WAAW,eAAe,MACzD,CAAA,EACF,kBAAC,QAAD;MACE,WAAW,iFACT,EAAS,WACL,sCACA;gBAGL,EAAS;MACL,CAAA,CACA;OAvBF,EAAS,KAuBP,CACT;IACE,CAAA;GAGN,kBAAC,KAAD;IAAG,WAAU;cAAb;KACG,EAAG,oCAAoC,2BAA2B;KAAE;KACrE,kBAAC,UAAD;MACE,eAAe,EAAS,cAAc;MACtC,WAAU;gBAET,EAAG,wBAAwB,UAAU;MAC/B,CAAA;KACP;;GACO"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SSORelayCallbackPage — Receives tokens from the SSO relay and stores them locally.
|
|
3
|
+
*
|
|
4
|
+
* Tokens arrive in the URL fragment (#sso=<base64>) which is never sent to servers.
|
|
5
|
+
* After storing in localStorage, redirects to the returnTo path.
|
|
6
|
+
*/
|
|
7
|
+
export declare function SSORelayCallbackPage(): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=SSORelayCallbackPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SSORelayCallbackPage.d.ts","sourceRoot":"","sources":["../../../src/auth/pages/SSORelayCallbackPage.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAoBH,wBAAgB,oBAAoB,4CA0DnC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { useAuthStore as e } from "../store/authStore.js";
|
|
2
|
+
import { useEffect as t } from "react";
|
|
3
|
+
import { useSearchParams as n } from "react-router-dom";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
import { setSSoCookie as i } from "@burdenoff/fe-libs/shared/utils";
|
|
6
|
+
import { getAuthBridge as a } from "@burdenoff/fe-libs/shared/providers/shell/AuthBridgeClient";
|
|
7
|
+
//#region src/auth/pages/SSORelayCallbackPage.tsx
|
|
8
|
+
function o(e) {
|
|
9
|
+
if (!e) return "/dashboard";
|
|
10
|
+
try {
|
|
11
|
+
let t = new URL(e, window.location.origin);
|
|
12
|
+
return t.origin === window.location.origin ? `${t.pathname}${t.search}${t.hash}` : "/dashboard";
|
|
13
|
+
} catch {
|
|
14
|
+
return "/dashboard";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function s() {
|
|
18
|
+
let [s] = n();
|
|
19
|
+
return t(() => {
|
|
20
|
+
let t = o(s.get("returnTo")), n = window.location.hash;
|
|
21
|
+
if (!n.startsWith("#sso=")) {
|
|
22
|
+
window.location.replace("/auth/login");
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
let r = n.slice(5), { profileId: o, tokens: s, user: c, profiles: l } = JSON.parse(atob(r));
|
|
27
|
+
if (!o || !s) {
|
|
28
|
+
window.location.replace("/auth/login");
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
localStorage.setItem(`bf-p-${o}-tokens`, s), c && localStorage.setItem(`bf-p-${o}-user`, c), l && localStorage.setItem("bf-profiles", l), sessionStorage.setItem("bf-active-profile", o), i(o), e.getState().loadFromProfile(o), window.dispatchEvent(new Event("bf-profile-storage-change")), a()?.notifyLogin({
|
|
32
|
+
user: c ? JSON.parse(c) : null,
|
|
33
|
+
tokens: s ? JSON.parse(s) : null,
|
|
34
|
+
activeProfileId: o,
|
|
35
|
+
profiles: l ? JSON.parse(l) : []
|
|
36
|
+
}), window.location.replace(t);
|
|
37
|
+
} catch {
|
|
38
|
+
window.location.replace("/auth/login");
|
|
39
|
+
}
|
|
40
|
+
}, [s]), /* @__PURE__ */ r("div", {
|
|
41
|
+
className: "flex items-center justify-center min-h-screen bg-bg-canvas",
|
|
42
|
+
children: /* @__PURE__ */ r("div", { className: "animate-spin rounded-full h-8 w-8 border-2 border-action-primary-bg border-t-transparent" })
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { s as SSORelayCallbackPage };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=SSORelayCallbackPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SSORelayCallbackPage.js","names":[],"sources":["../../../src/auth/pages/SSORelayCallbackPage.tsx"],"sourcesContent":["/**\n * SSORelayCallbackPage — Receives tokens from the SSO relay and stores them locally.\n *\n * Tokens arrive in the URL fragment (#sso=<base64>) which is never sent to servers.\n * After storing in localStorage, redirects to the returnTo path.\n */\n\nimport { useEffect } from \"react\";\nimport { useSearchParams } from \"react-router-dom\";\nimport { getAuthBridge } from \"@burdenoff/fe-libs/shared/providers/shell/AuthBridgeClient\";\nimport { setSSoCookie } from \"@burdenoff/fe-libs/shared/utils\";\nimport { useAuthStore } from \"../store/authStore\";\n\nfunction getSafeReturnTo(returnTo: string | null): string {\n if (!returnTo) return \"/dashboard\";\n\n try {\n const url = new URL(returnTo, window.location.origin);\n if (url.origin !== window.location.origin) return \"/dashboard\";\n return `${url.pathname}${url.search}${url.hash}`;\n } catch {\n return \"/dashboard\";\n }\n}\n\nexport function SSORelayCallbackPage() {\n const [searchParams] = useSearchParams();\n\n useEffect(() => {\n const returnTo = getSafeReturnTo(searchParams.get(\"returnTo\"));\n const hash = window.location.hash;\n\n if (!hash.startsWith(\"#sso=\")) {\n // No SSO data — redirect to login\n window.location.replace(\"/auth/login\");\n return;\n }\n\n try {\n const encoded = hash.slice(5); // Remove \"#sso=\"\n const payload = JSON.parse(atob(encoded));\n const { profileId, tokens, user, profiles } = payload;\n\n if (!profileId || !tokens) {\n window.location.replace(\"/auth/login\");\n return;\n }\n\n // Store tokens in localStorage\n localStorage.setItem(`bf-p-${profileId}-tokens`, tokens);\n if (user) {\n localStorage.setItem(`bf-p-${profileId}-user`, user);\n }\n if (profiles) {\n localStorage.setItem(\"bf-profiles\", profiles);\n }\n sessionStorage.setItem(\"bf-active-profile\", profileId);\n setSSoCookie(profileId);\n useAuthStore.getState().loadFromProfile(profileId);\n\n // Dispatch event so AuthProvider picks up the new state\n window.dispatchEvent(new Event(\"bf-profile-storage-change\"));\n\n // Notify the auth bridge so other open shells can pick up the new session\n getAuthBridge()?.notifyLogin({\n user: user ? JSON.parse(user) : null,\n tokens: tokens ? JSON.parse(tokens) : null,\n activeProfileId: profileId,\n profiles: profiles ? JSON.parse(profiles) : [],\n });\n\n // Clear the hash and redirect\n window.location.replace(returnTo);\n } catch {\n window.location.replace(\"/auth/login\");\n }\n }, [searchParams]);\n\n return (\n <div className=\"flex items-center justify-center min-h-screen bg-bg-canvas\">\n <div className=\"animate-spin rounded-full h-8 w-8 border-2 border-action-primary-bg border-t-transparent\" />\n </div>\n );\n}\n"],"mappings":";;;;;;;AAaA,SAAS,EAAgB,GAAiC;AACxD,KAAI,CAAC,EAAU,QAAO;AAEtB,KAAI;EACF,IAAM,IAAM,IAAI,IAAI,GAAU,OAAO,SAAS,OAAO;AAErD,SADI,EA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age — Cross-domain SSO token relay.
|
|
3
|
+
*
|
|
4
|
+
* This page is loaded on the ORIGIN where the user is logged in.
|
|
5
|
+
* It reads tokens from localStorage and redirects to the TARGET domain's
|
|
6
|
+
* /auth/sso-callback with the tokens in a URL fragment (not query param
|
|
7
|
+
* for security — fragments are not sent to servers).
|
|
8
|
+
*
|
|
9
|
+
* Flow:
|
|
10
|
+
* 1. User visits productA.com → not logged in → detects SSO cookie
|
|
11
|
+
* 2. Redirect to productB.com/auth/sso-relay?returnTo=productA.com/dashboard
|
|
12
|
+
* (productB is where the user IS logged in — identified by cookie)
|
|
13
|
+
* 3. This page reads tokens from productB's localStorage
|
|
14
|
+
* 4. Redirects to productA.com/auth/sso-callback#token=<base64-encoded-tokens>
|
|
15
|
+
* 5. SSORelayCallbackPage on productA decodes and stores tokens, redirects to /dashboard
|
|
16
|
+
*/
|
|
17
|
+
export declare function SSORelayPage(): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=SSORelayPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SSORelayPage.d.ts","sourceRoot":"","sources":["../../../src/auth/pages/SSORelayPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAgNH,wBAAgB,YAAY,4CAoE3B"}
|