@hexclave/next 1.0.63 → 1.0.65

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.
Files changed (115) hide show
  1. package/dist/{admin-app-impl-CeDMhwUz.d.ts → admin-app-impl-BsmwXslH.d.ts} +8 -8
  2. package/dist/{admin-app-impl-CeDMhwUz.d.ts.map → admin-app-impl-BsmwXslH.d.ts.map} +1 -1
  3. package/dist/auth-page-YnM_LtbN.d.ts.map +1 -1
  4. package/dist/cli-auth-confirm-BW3PYpKb.d.ts.map +1 -1
  5. package/dist/clickmap/clickmap-core.js +1 -1
  6. package/dist/clickmap/index.js +2 -2
  7. package/dist/components/api-key-dialogs.js +2 -2
  8. package/dist/components/credential-sign-in.js +1 -1
  9. package/dist/components/credential-sign-up.js +1 -1
  10. package/dist/components/magic-link-sign-in.js +1 -1
  11. package/dist/components/message-cards/no-auth-methods-message-card.d.ts +13 -0
  12. package/dist/components/message-cards/no-auth-methods-message-card.d.ts.map +1 -0
  13. package/dist/components/message-cards/no-auth-methods-message-card.js +75 -0
  14. package/dist/components/message-cards/no-auth-methods-message-card.js.map +1 -0
  15. package/dist/components/team-switcher.js +1 -1
  16. package/dist/components-page/account-settings/active-sessions/active-sessions-page.js +1 -1
  17. package/dist/components-page/account-settings/email-and-auth/emails-section.js +1 -1
  18. package/dist/components-page/account-settings/email-and-auth/mfa-section.js +1 -1
  19. package/dist/components-page/account-settings/email-and-auth/password-section.js +1 -1
  20. package/dist/components-page/account-settings/teams/team-creation-page.js +1 -1
  21. package/dist/components-page/account-settings/teams/team-member-invitation-section.js +1 -1
  22. package/dist/components-page/auth-page.js +8 -3
  23. package/dist/components-page/auth-page.js.map +1 -1
  24. package/dist/components-page/cli-auth-confirm.js +8 -2
  25. package/dist/components-page/cli-auth-confirm.js.map +1 -1
  26. package/dist/components-page/cli-auth-confirm.test.js +43 -1
  27. package/dist/components-page/cli-auth-confirm.test.js.map +1 -1
  28. package/dist/components-page/forgot-password.js +1 -1
  29. package/dist/components-page/oauth-callback.js +2 -2
  30. package/dist/components-page/oauth-callback.test.js +1 -1
  31. package/dist/components-page/onboarding.js +1 -1
  32. package/dist/components-page/password-reset.js +1 -1
  33. package/dist/components-page/sign-out.test.js +1 -1
  34. package/dist/components-page/team-creation.js +1 -1
  35. package/dist/dev-tool/dev-tool-core.js +1 -1
  36. package/dist/dev-tool/index.js +1 -1
  37. package/dist/esm/clickmap/clickmap-core.js +1 -1
  38. package/dist/esm/clickmap/index.js +2 -2
  39. package/dist/esm/components/api-key-dialogs.js +2 -2
  40. package/dist/esm/components/credential-sign-in.js +1 -1
  41. package/dist/esm/components/credential-sign-up.js +1 -1
  42. package/dist/esm/components/magic-link-sign-in.js +1 -1
  43. package/dist/esm/components/message-cards/no-auth-methods-message-card.d.ts +13 -0
  44. package/dist/esm/components/message-cards/no-auth-methods-message-card.d.ts.map +1 -0
  45. package/dist/esm/components/message-cards/no-auth-methods-message-card.js +74 -0
  46. package/dist/esm/components/message-cards/no-auth-methods-message-card.js.map +1 -0
  47. package/dist/esm/components/team-switcher.js +1 -1
  48. package/dist/esm/components-page/account-settings/active-sessions/active-sessions-page.js +1 -1
  49. package/dist/esm/components-page/account-settings/email-and-auth/emails-section.js +1 -1
  50. package/dist/esm/components-page/account-settings/email-and-auth/mfa-section.js +1 -1
  51. package/dist/esm/components-page/account-settings/email-and-auth/password-section.js +1 -1
  52. package/dist/esm/components-page/account-settings/teams/team-creation-page.js +1 -1
  53. package/dist/esm/components-page/account-settings/teams/team-member-invitation-section.js +1 -1
  54. package/dist/esm/components-page/auth-page.d.ts.map +1 -1
  55. package/dist/esm/components-page/auth-page.js +8 -3
  56. package/dist/esm/components-page/auth-page.js.map +1 -1
  57. package/dist/esm/components-page/cli-auth-confirm.d.ts.map +1 -1
  58. package/dist/esm/components-page/cli-auth-confirm.js +8 -2
  59. package/dist/esm/components-page/cli-auth-confirm.js.map +1 -1
  60. package/dist/esm/components-page/cli-auth-confirm.test.js +43 -1
  61. package/dist/esm/components-page/cli-auth-confirm.test.js.map +1 -1
  62. package/dist/esm/components-page/forgot-password.js +1 -1
  63. package/dist/esm/components-page/oauth-callback.js +2 -2
  64. package/dist/esm/components-page/oauth-callback.test.js +1 -1
  65. package/dist/esm/components-page/onboarding.js +1 -1
  66. package/dist/esm/components-page/password-reset.js +1 -1
  67. package/dist/esm/components-page/sign-out.test.js +1 -1
  68. package/dist/esm/components-page/team-creation.js +1 -1
  69. package/dist/esm/dev-tool/dev-tool-core.js +1 -1
  70. package/dist/esm/dev-tool/index.js +1 -1
  71. package/dist/esm/generated/global-css.d.ts +1 -1
  72. package/dist/esm/generated/global-css.js +1 -1
  73. package/dist/esm/generated/global-css.js.map +1 -1
  74. package/dist/esm/generated/quetzal-translations.d.ts +2 -2
  75. package/dist/esm/lib/auth.js +1 -1
  76. package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +5 -5
  77. package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.d.ts +2 -2
  78. package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.js +2 -2
  79. package/dist/esm/lib/hexclave-app/apps/implementations/common.js +4 -4
  80. package/dist/esm/lib/hexclave-app/apps/implementations/event-tracker.js +1 -1
  81. package/dist/esm/lib/hexclave-app/apps/implementations/server-app-impl.d.ts +1 -1
  82. package/dist/esm/lib/hexclave-app/apps/implementations/server-app-impl.js +1 -1
  83. package/dist/esm/lib/hexclave-app/apps/implementations/session-replay.js +1 -1
  84. package/dist/esm/providers/theme-provider.js +1 -1
  85. package/dist/esm/pushed-config-error-overlay/index.js +1 -1
  86. package/dist/generated/global-css.d.ts +1 -1
  87. package/dist/generated/global-css.js +1 -1
  88. package/dist/generated/global-css.js.map +1 -1
  89. package/dist/generated/quetzal-translations.d.ts +1 -1
  90. package/dist/{hexclave-provider-TnvTTUYV.d.ts → hexclave-provider-BxrgPM5P.d.ts} +2 -2
  91. package/dist/{hexclave-provider-TnvTTUYV.d.ts.map → hexclave-provider-BxrgPM5P.d.ts.map} +1 -1
  92. package/dist/index.d.ts +1 -1
  93. package/dist/lib/auth.js +1 -1
  94. package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +1 -1
  95. package/dist/lib/hexclave-app/apps/implementations/client-app-impl.d.ts +1 -1
  96. package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js +2 -2
  97. package/dist/lib/hexclave-app/apps/implementations/common.js +4 -4
  98. package/dist/lib/hexclave-app/apps/implementations/event-tracker.js +1 -1
  99. package/dist/lib/hexclave-app/apps/implementations/index.d.ts +1 -1
  100. package/dist/lib/hexclave-app/apps/implementations/server-app-impl.d.ts +1 -1
  101. package/dist/lib/hexclave-app/apps/implementations/server-app-impl.js +1 -1
  102. package/dist/lib/hexclave-app/apps/implementations/session-replay.js +1 -1
  103. package/dist/providers/hexclave-provider.d.ts +1 -1
  104. package/dist/providers/theme-provider.js +1 -1
  105. package/dist/providers/translation-provider.d.ts +1 -1
  106. package/dist/pushed-config-error-overlay/index.js +1 -1
  107. package/dist/{quetzal-translations-BfUU6n9d.d.ts → quetzal-translations-XeH3zQ9l.d.ts} +3 -3
  108. package/dist/{quetzal-translations-BfUU6n9d.d.ts.map → quetzal-translations-XeH3zQ9l.d.ts.map} +1 -1
  109. package/dist/{translation-provider-CXI6rdR3.d.ts → translation-provider-WOaZXqAz.d.ts} +2 -2
  110. package/dist/{translation-provider-CXI6rdR3.d.ts.map → translation-provider-WOaZXqAz.d.ts.map} +1 -1
  111. package/package.json +4 -4
  112. package/src/components/message-cards/no-auth-methods-message-card.tsx +57 -0
  113. package/src/components-page/auth-page.tsx +18 -1
  114. package/src/components-page/cli-auth-confirm.test.tsx +55 -0
  115. package/src/components-page/cli-auth-confirm.tsx +11 -1
@@ -1 +1 @@
1
- {"version":3,"file":"cli-auth-confirm.js","names":["hexclaveAppInternalsSymbol","MessageCard","Typography"],"sources":["../../src/components-page/cli-auth-confirm.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\nimport { Typography } from \"@hexclave/ui\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { MessageCard } from \"../components/message-cards/message-card\";\nimport { useTranslation } from \"../lib/translations\";\nimport { hexclaveAppInternalsSymbol } from \"../lib/hexclave-app/common\";\nimport type { StackClientApp } from \"../lib/hexclave-app/apps/interfaces/client-app\";\nimport { useStackApp } from \"../lib/hooks\";\n\nasync function postCliAuthComplete(app: StackClientApp, body: Record<string, unknown>) {\n return await app[hexclaveAppInternalsSymbol].sendRequest(\"/auth/cli/complete\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(body),\n });\n}\n\nasync function ensureCliCompleteOk(result: Response) {\n if (!result.ok) {\n throw new Error(`Authorization failed: ${result.status} ${await result.text()}`);\n }\n}\n\nasync function completeCliAuthWithRefreshToken(app: StackClientApp, loginCode: string, refreshToken: string) {\n const result = await postCliAuthComplete(app, { login_code: loginCode, refresh_token: refreshToken });\n await ensureCliCompleteOk(result);\n}\n\n// Hexclave rebrand: sessionStorage key — straight rename (per-tab, low TTL).\nconst CLI_AUTH_CONFIRMED_KEY = \"hexclave-cli-auth-confirmed\";\n\nfunction markConfirmed(loginCode: string) {\n sessionStorage.setItem(CLI_AUTH_CONFIRMED_KEY, loginCode);\n}\n\nfunction isConfirmed(loginCode: string): boolean {\n return sessionStorage.getItem(CLI_AUTH_CONFIRMED_KEY) === loginCode;\n}\n\nfunction clearConfirmed() {\n sessionStorage.removeItem(CLI_AUTH_CONFIRMED_KEY);\n}\n\nfunction getError(err: unknown): Error {\n return err instanceof Error ? err : new Error(String(err));\n}\n\nfunction getObjectField(data: unknown, fieldName: string): unknown {\n return typeof data === \"object\" && data !== null && fieldName in data\n ? data[fieldName as keyof typeof data]\n : undefined;\n}\n\nfunction getStringField(data: unknown, fieldName: string): string | undefined {\n const value = getObjectField(data, fieldName);\n return typeof value === \"string\" ? value : undefined;\n}\n\nexport type CliAuthConfirmationStatus =\n | \"idle\"\n | \"invalid\"\n | \"authorizing\"\n | \"redirecting\"\n | \"success\"\n | \"error\";\n\nexport type CliAuthConfirmationState = {\n status: CliAuthConfirmationStatus,\n loginCode: string | null,\n error: Error | null,\n isLoading: boolean,\n authorize: () => Promise<void>,\n retry: () => void,\n};\n\nexport function useCliAuthConfirmation(): CliAuthConfirmationState {\n const app = useStackApp();\n const user = app.useUser({ includeRestricted: true });\n const [status, setStatus] = useState<Exclude<CliAuthConfirmationStatus, \"invalid\">>(\"idle\");\n const [error, setError] = useState<Error | null>(null);\n const autoCompleteRef = useRef(false);\n const authorizeInProgressRef = useRef(false);\n const [loginCode] = useState(() => {\n if (typeof window === 'undefined') return null;\n return new URLSearchParams(window.location.search).get(\"login_code\");\n });\n const [confirmed] = useState(() => {\n if (typeof window === 'undefined') return false;\n return loginCode != null && isConfirmed(loginCode);\n });\n\n const completeWithCurrentUser = useCallback(async () => {\n if (!loginCode) {\n throw new Error(\"Missing login code in URL parameters\");\n }\n if (!user) {\n throw new Error(\"Cannot complete CLI authorization without a signed-in user\");\n }\n const refreshToken = (await user.currentSession.getTokens()).refreshToken;\n if (!refreshToken) {\n throw new Error(\"Could not retrieve session token\");\n }\n await completeCliAuthWithRefreshToken(app, loginCode, refreshToken);\n }, [app, loginCode, user]);\n\n useEffect(() => {\n if (!confirmed || !user || autoCompleteRef.current) {\n return;\n }\n autoCompleteRef.current = true;\n runAsynchronouslyWithAlert(async () => {\n setStatus(\"authorizing\");\n try {\n await completeWithCurrentUser();\n clearConfirmed();\n setStatus(\"success\");\n } catch (err) {\n setError(getError(err));\n setStatus(\"error\");\n }\n });\n }, [confirmed, user, completeWithCurrentUser]);\n\n const authorize = useCallback(async () => {\n if (authorizeInProgressRef.current) {\n return;\n }\n authorizeInProgressRef.current = true;\n\n try {\n if (!loginCode) {\n setError(new Error(\"Missing login code in URL parameters\"));\n setStatus(\"error\");\n return;\n }\n\n setError(null);\n setStatus(\"authorizing\");\n if (user) {\n await completeWithCurrentUser();\n clearConfirmed();\n setStatus(\"success\");\n return;\n }\n\n const checkResult = await postCliAuthComplete(app, { login_code: loginCode, mode: \"check\" });\n if (!checkResult.ok) {\n throw new Error(`Failed to verify login code: ${checkResult.status} ${await checkResult.text()}`);\n }\n const checkData: unknown = await checkResult.json();\n const cliSessionState = getStringField(checkData, \"cli_session_state\") ?? null;\n\n if (cliSessionState === \"anonymous\") {\n const claimResult = await postCliAuthComplete(app, { login_code: loginCode, mode: \"claim-anon-session\" });\n\n if (!claimResult.ok) {\n throw new Error(`Failed to claim anonymous session: ${claimResult.status} ${await claimResult.text()}`);\n }\n\n const tokens: unknown = await claimResult.json();\n const accessToken = getStringField(tokens, \"access_token\");\n const refreshToken = getStringField(tokens, \"refresh_token\");\n if (!accessToken || !refreshToken) {\n throw new Error(\"Anonymous CLI session claim did not return tokens\");\n }\n await app[hexclaveAppInternalsSymbol].signInWithTokens({\n accessToken,\n refreshToken,\n });\n markConfirmed(loginCode);\n setStatus(\"redirecting\");\n await app.redirectToSignUp({ replace: true });\n return;\n }\n\n markConfirmed(loginCode);\n setStatus(\"redirecting\");\n await app.redirectToSignIn({ replace: true });\n } catch (err) {\n setError(getError(err));\n setStatus(\"error\");\n } finally {\n authorizeInProgressRef.current = false;\n }\n }, [app, completeWithCurrentUser, loginCode, user]);\n\n const retry = useCallback(() => {\n setError(null);\n autoCompleteRef.current = false;\n setStatus(\"idle\");\n }, []);\n\n const visibleStatus = loginCode == null ? \"invalid\" : status;\n return {\n status: visibleStatus,\n loginCode,\n error,\n isLoading: visibleStatus === \"authorizing\" || visibleStatus === \"redirecting\",\n authorize,\n retry,\n };\n}\n\nexport function CliAuthConfirmation({ fullPage = true }: { fullPage?: boolean }) {\n const { t } = useTranslation();\n const cliAuth = useCliAuthConfirmation();\n\n if (cliAuth.status === \"success\") {\n return (\n <MessageCard title={t(\"CLI Authorization Successful\")} fullPage={fullPage}>\n <Typography>\n {t(\"The CLI application has been authorized successfully. You can close this window and return to the command line.\")}\n </Typography>\n </MessageCard>\n );\n }\n\n if (cliAuth.status === \"error\") {\n return (\n <MessageCard\n title={t(\"Authorization Failed\")}\n fullPage={fullPage}\n primaryButtonText={t(\"Try Again\")}\n primaryAction={cliAuth.retry}\n >\n <Typography className=\"text-red-600\">\n {t(\"Failed to authorize the CLI application:\")}\n </Typography>\n <Typography className=\"text-red-600\">\n {cliAuth.error?.message}\n </Typography>\n </MessageCard>\n );\n }\n\n if (cliAuth.status === \"invalid\") {\n return (\n <MessageCard title={t(\"Invalid CLI Authorization Link\")} fullPage={fullPage}>\n <Typography className=\"text-red-600\">\n {t(\"This CLI authorization link is missing a login code. Please return to the command line and start the login process again.\")}\n </Typography>\n </MessageCard>\n );\n }\n\n if (cliAuth.status === \"authorizing\" || cliAuth.status === \"redirecting\") {\n return (\n <MessageCard title={t(\"Completing Authorization...\")} fullPage={fullPage}>\n <Typography>\n {t(\"Finishing up the CLI authorization...\")}\n </Typography>\n </MessageCard>\n );\n }\n\n return (\n <MessageCard\n title={t(\"Authorize CLI Application\")}\n fullPage={fullPage}\n primaryButtonText={cliAuth.isLoading ? t(\"Authorizing...\") : t(\"Authorize\")}\n primaryAction={cliAuth.authorize}\n >\n <Typography>\n {t(\"A command line application is requesting access to your account. Click the button below to authorize it.\")}\n </Typography>\n <Typography variant=\"destructive\">\n {t(\"WARNING: Make sure you trust the command line application, as it will gain access to your account. If you did not initiate this request, you can close this page and ignore it. We will never send you this link via email or any other means.\")}\n </Typography>\n </MessageCard>\n );\n}\n"],"mappings":";;;;;;;;;;;AAgBA,eAAe,oBAAoB,KAAqB,MAA+B;CACrF,OAAO,MAAM,IAAIA,8BAAAA,2BAA2B,CAAC,YAAY,sBAAsB;EAC7E,QAAQ;EACR,SAAS,EAAE,gBAAgB,mBAAmB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AAA;CACD,CAAA;CAIjB,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACD,4CAAAA,aAAD;EACE,OAAO,EAAE,2BAA2B;EAC1B;EACV,mBAAmB,QAAQ,YAAY,EAAE,gBAAgB,IAAI,EAAE,WAAW;EAC1E,eAAe,QAAQ;YAJzB,CAME,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,YAAD,EAAA,UACG,EAAE,0GAA0G,EACnG,CAAA,GACZ,iBAAA,GAAA,kBAAA,IAAA,CAACA,aAAAA,YAAD;GAAY,SAAQ;aACjB,EAAE,gPAAgP;EACzO,CAAA,CACD;;AAEjB"}
1
+ {"version":3,"file":"cli-auth-confirm.js","names":["hexclaveAppInternalsSymbol","MessageCard","Typography"],"sources":["../../src/components-page/cli-auth-confirm.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\nimport { Typography } from \"@hexclave/ui\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { MessageCard } from \"../components/message-cards/message-card\";\nimport { useTranslation } from \"../lib/translations\";\nimport { hexclaveAppInternalsSymbol } from \"../lib/hexclave-app/common\";\nimport type { StackClientApp } from \"../lib/hexclave-app/apps/interfaces/client-app\";\nimport { useStackApp } from \"../lib/hooks\";\n\nasync function postCliAuthComplete(app: StackClientApp, body: Record<string, unknown>) {\n return await app[hexclaveAppInternalsSymbol].sendRequest(\"/auth/cli/complete\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(body),\n });\n}\n\nasync function ensureCliCompleteOk(result: Response) {\n if (!result.ok) {\n throw new Error(`Authorization failed: ${result.status} ${await result.text()}`);\n }\n}\n\nasync function completeCliAuthWithRefreshToken(app: StackClientApp, loginCode: string, refreshToken: string) {\n const result = await postCliAuthComplete(app, { login_code: loginCode, refresh_token: refreshToken });\n await ensureCliCompleteOk(result);\n}\n\n// Hexclave rebrand: sessionStorage key — straight rename (per-tab, low TTL).\nconst CLI_AUTH_CONFIRMED_KEY = \"hexclave-cli-auth-confirmed\";\n\nfunction markConfirmed(loginCode: string) {\n sessionStorage.setItem(CLI_AUTH_CONFIRMED_KEY, loginCode);\n}\n\nfunction isConfirmed(loginCode: string): boolean {\n return sessionStorage.getItem(CLI_AUTH_CONFIRMED_KEY) === loginCode;\n}\n\nfunction clearConfirmed() {\n sessionStorage.removeItem(CLI_AUTH_CONFIRMED_KEY);\n}\n\nfunction getError(err: unknown): Error {\n return err instanceof Error ? err : new Error(String(err));\n}\n\nfunction getObjectField(data: unknown, fieldName: string): unknown {\n return typeof data === \"object\" && data !== null && fieldName in data\n ? data[fieldName as keyof typeof data]\n : undefined;\n}\n\nfunction getStringField(data: unknown, fieldName: string): string | undefined {\n const value = getObjectField(data, fieldName);\n return typeof value === \"string\" ? value : undefined;\n}\n\nexport type CliAuthConfirmationStatus =\n | \"idle\"\n | \"invalid\"\n | \"authorizing\"\n | \"redirecting\"\n | \"success\"\n | \"error\";\n\nexport type CliAuthConfirmationState = {\n status: CliAuthConfirmationStatus,\n loginCode: string | null,\n error: Error | null,\n isLoading: boolean,\n authorize: () => Promise<void>,\n retry: () => void,\n};\n\nexport function useCliAuthConfirmation(): CliAuthConfirmationState {\n const app = useStackApp();\n const user = app.useUser({ includeRestricted: true });\n const [status, setStatus] = useState<Exclude<CliAuthConfirmationStatus, \"invalid\">>(\"idle\");\n const [error, setError] = useState<Error | null>(null);\n const autoCompleteRef = useRef(false);\n const authorizeInProgressRef = useRef(false);\n const [loginCode] = useState(() => {\n if (typeof window === 'undefined') return null;\n return new URLSearchParams(window.location.search).get(\"login_code\");\n });\n const [confirmed] = useState(() => {\n if (typeof window === 'undefined') return false;\n return loginCode != null && isConfirmed(loginCode);\n });\n\n const completeWithCurrentUser = useCallback(async () => {\n if (!loginCode) {\n throw new Error(\"Missing login code in URL parameters\");\n }\n if (!user) {\n throw new Error(\"Cannot complete CLI authorization without a signed-in user\");\n }\n const refreshToken = (await user.currentSession.getTokens()).refreshToken;\n if (!refreshToken) {\n throw new Error(\"Could not retrieve session token\");\n }\n await completeCliAuthWithRefreshToken(app, loginCode, refreshToken);\n }, [app, loginCode, user]);\n\n useEffect(() => {\n if (!confirmed || !user || user.isRestricted || autoCompleteRef.current) {\n return;\n }\n autoCompleteRef.current = true;\n runAsynchronouslyWithAlert(async () => {\n setStatus(\"authorizing\");\n try {\n await completeWithCurrentUser();\n clearConfirmed();\n setStatus(\"success\");\n } catch (err) {\n setError(getError(err));\n setStatus(\"error\");\n }\n });\n }, [confirmed, user, completeWithCurrentUser]);\n\n const authorize = useCallback(async () => {\n if (authorizeInProgressRef.current) {\n return;\n }\n authorizeInProgressRef.current = true;\n\n try {\n if (!loginCode) {\n setError(new Error(\"Missing login code in URL parameters\"));\n setStatus(\"error\");\n return;\n }\n\n setError(null);\n setStatus(\"authorizing\");\n if (user) {\n if (user.isRestricted) {\n markConfirmed(loginCode);\n setStatus(\"redirecting\");\n await (\n user.isAnonymous\n ? app.redirectToSignUp({ replace: true })\n : app.redirectToOnboarding({ replace: true })\n );\n return;\n }\n await completeWithCurrentUser();\n clearConfirmed();\n setStatus(\"success\");\n return;\n }\n\n const checkResult = await postCliAuthComplete(app, { login_code: loginCode, mode: \"check\" });\n if (!checkResult.ok) {\n throw new Error(`Failed to verify login code: ${checkResult.status} ${await checkResult.text()}`);\n }\n const checkData: unknown = await checkResult.json();\n const cliSessionState = getStringField(checkData, \"cli_session_state\") ?? null;\n\n if (cliSessionState === \"anonymous\") {\n const claimResult = await postCliAuthComplete(app, { login_code: loginCode, mode: \"claim-anon-session\" });\n\n if (!claimResult.ok) {\n throw new Error(`Failed to claim anonymous session: ${claimResult.status} ${await claimResult.text()}`);\n }\n\n const tokens: unknown = await claimResult.json();\n const accessToken = getStringField(tokens, \"access_token\");\n const refreshToken = getStringField(tokens, \"refresh_token\");\n if (!accessToken || !refreshToken) {\n throw new Error(\"Anonymous CLI session claim did not return tokens\");\n }\n await app[hexclaveAppInternalsSymbol].signInWithTokens({\n accessToken,\n refreshToken,\n });\n markConfirmed(loginCode);\n setStatus(\"redirecting\");\n await app.redirectToSignUp({ replace: true });\n return;\n }\n\n markConfirmed(loginCode);\n setStatus(\"redirecting\");\n await app.redirectToSignIn({ replace: true });\n } catch (err) {\n setError(getError(err));\n setStatus(\"error\");\n } finally {\n authorizeInProgressRef.current = false;\n }\n }, [app, completeWithCurrentUser, loginCode, user]);\n\n const retry = useCallback(() => {\n setError(null);\n autoCompleteRef.current = false;\n setStatus(\"idle\");\n }, []);\n\n const visibleStatus = loginCode == null ? \"invalid\" : status;\n return {\n status: visibleStatus,\n loginCode,\n error,\n isLoading: visibleStatus === \"authorizing\" || visibleStatus === \"redirecting\",\n authorize,\n retry,\n };\n}\n\nexport function CliAuthConfirmation({ fullPage = true }: { fullPage?: boolean }) {\n const { t } = useTranslation();\n const cliAuth = useCliAuthConfirmation();\n\n if (cliAuth.status === \"success\") {\n return (\n <MessageCard title={t(\"CLI Authorization Successful\")} fullPage={fullPage}>\n <Typography>\n {t(\"The CLI application has been authorized successfully. You can close this window and return to the command line.\")}\n </Typography>\n </MessageCard>\n );\n }\n\n if (cliAuth.status === \"error\") {\n return (\n <MessageCard\n title={t(\"Authorization Failed\")}\n fullPage={fullPage}\n primaryButtonText={t(\"Try Again\")}\n primaryAction={cliAuth.retry}\n >\n <Typography className=\"text-red-600\">\n {t(\"Failed to authorize the CLI application:\")}\n </Typography>\n <Typography className=\"text-red-600\">\n {cliAuth.error?.message}\n </Typography>\n </MessageCard>\n );\n }\n\n if (cliAuth.status === \"invalid\") {\n return (\n <MessageCard title={t(\"Invalid CLI Authorization Link\")} fullPage={fullPage}>\n <Typography className=\"text-red-600\">\n {t(\"This CLI authorization link is missing a login code. Please return to the command line and start the login process again.\")}\n </Typography>\n </MessageCard>\n );\n }\n\n if (cliAuth.status === \"authorizing\" || cliAuth.status === \"redirecting\") {\n return (\n <MessageCard title={t(\"Completing Authorization...\")} fullPage={fullPage}>\n <Typography>\n {t(\"Finishing up the CLI authorization...\")}\n </Typography>\n </MessageCard>\n );\n }\n\n return (\n <MessageCard\n title={t(\"Authorize CLI Application\")}\n fullPage={fullPage}\n primaryButtonText={cliAuth.isLoading ? t(\"Authorizing...\") : t(\"Authorize\")}\n primaryAction={cliAuth.authorize}\n >\n <Typography>\n {t(\"A command line application is requesting access to your account. Click the button below to authorize it.\")}\n </Typography>\n <Typography variant=\"destructive\">\n {t(\"WARNING: Make sure you trust the command line application, as it will gain access to your account. If you did not initiate this request, you can close this page and ignore it. We will never send you this link via email or any other means.\")}\n </Typography>\n </MessageCard>\n );\n}\n"],"mappings":";;;;;;;;;;;AAgBA,eAAe,oBAAoB,KAAqB,MAA+B;CACrF,OAAO,MAAM,IAAIA,8BAAAA,2BAA2B,CAAC,YAAY,sBAAsB;EAC7E,QAAQ;EACR,SAAS,EAAE,gBAAgB,mBAAmB;EAC9C,MAAM,KAAK,UAAU,IAAI;CAC3B,CAAC;AACH;AAEA,eAAe,oBAAoB,QAAkB;CACnD,IAAI,CAAC,OAAO,IACV,MAAM,IAAI,MAAM,yBAAyB,OAAO,OAAO,GAAG,MAAM,OAAO,KAAK,GAAG;AAEnF;AAEA,eAAe,gCAAgC,KAAqB,WAAmB,cAAsB;CAE3G,MAAM,oBAAoB,MADL,oBAAoB,KAAK;EAAE,YAAY;EAAW,eAAe;CAAa,CAAC,CACpE;AAClC;AAGA,MAAM,yBAAyB;AAE/B,SAAS,cAAc,WAAmB;CACxC,eAAe,QAAQ,wBAAwB,SAAS;AAC1D;AAEA,SAAS,YAAY,WAA4B;CAC/C,OAAO,eAAe,QAAQ,sBAAsB,MAAM;AAC5D;AAEA,SAAS,iBAAiB;CACxB,eAAe,WAAW,sBAAsB;AAClD;AAEA,SAAS,SAAS,KAAqB;CACrC,OA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O,CAAA,CACD;;AAEjB"}
@@ -1,9 +1,9 @@
1
1
  const require_rolldown_runtime = require("../rolldown-runtime-D6vf50IK.js");
2
2
  let _hexclave_shared_dist_utils_promises = require("@hexclave/shared/dist/utils/promises");
3
+ let ___lib_hexclave_app_common_js = require("../lib/hexclave-app/common.js");
3
4
  let react = require("react");
4
5
  react = require_rolldown_runtime.__toESM(react);
5
6
  let react_jsx_runtime = require("react/jsx-runtime");
6
- let ___lib_hexclave_app_common_js = require("../lib/hexclave-app/common.js");
7
7
  let react_dom_client = require("react-dom/client");
8
8
  let vitest = require("vitest");
9
9
  let ___providers_hexclave_context_js = require("../providers/hexclave-context.js");
@@ -22,6 +22,7 @@ function createAppTestDouble(options) {
22
22
  useUser: () => options.user,
23
23
  redirectToSignIn: options.redirectToSignIn ?? vitest.vi.fn(async () => {}),
24
24
  redirectToSignUp: options.redirectToSignUp ?? vitest.vi.fn(async () => {}),
25
+ redirectToOnboarding: options.redirectToOnboarding ?? vitest.vi.fn(async () => {}),
25
26
  [___lib_hexclave_app_common_js.hexclaveAppInternalsSymbol]: {
26
27
  sendRequest: options.sendRequest,
27
28
  signInWithTokens: options.signInWithTokens ?? vitest.vi.fn(async () => {})
@@ -85,6 +86,7 @@ function getButton(label) {
85
86
  root = null;
86
87
  container = null;
87
88
  vitest.vi.restoreAllMocks();
89
+ sessionStorage.clear();
88
90
  window.history.replaceState({}, "", "/");
89
91
  Reflect.set(globalThis, "IS_REACT_ACT_ENVIRONMENT", previousActEnvironment);
90
92
  });
@@ -110,6 +112,46 @@ function getButton(label) {
110
112
  }
111
113
  `);
112
114
  });
115
+ (0, vitest.it)("redirects restricted users to onboarding without completing CLI auth", async () => {
116
+ window.history.replaceState({}, "", "/handler/cli-auth-confirm?login_code=login-code");
117
+ const redirectToOnboarding = vitest.vi.fn(async (_options) => {});
118
+ const sendRequest = vitest.vi.fn(async (_path, _requestOptions) => new Response(null, { status: 200 }));
119
+ await renderWithApp(createAppTestDouble({
120
+ user: {
121
+ isRestricted: true,
122
+ isAnonymous: false,
123
+ currentSession: { getTokens: vitest.vi.fn(async () => ({ refreshToken: "restricted-refresh-token" })) }
124
+ },
125
+ sendRequest,
126
+ redirectToOnboarding
127
+ }));
128
+ await (0, react.act)(async () => {
129
+ getButton("authorize").click();
130
+ });
131
+ (0, vitest.expect)(redirectToOnboarding).toHaveBeenCalledWith({ replace: true });
132
+ (0, vitest.expect)(sessionStorage.getItem("hexclave-cli-auth-confirmed")).toBe("login-code");
133
+ (0, vitest.expect)(sendRequest).not.toHaveBeenCalled();
134
+ });
135
+ (0, vitest.it)("redirects anonymous users to sign-up without completing CLI auth", async () => {
136
+ window.history.replaceState({}, "", "/handler/cli-auth-confirm?login_code=login-code");
137
+ const redirectToSignUp = vitest.vi.fn(async (_options) => {});
138
+ const sendRequest = vitest.vi.fn(async (_path, _requestOptions) => new Response(null, { status: 200 }));
139
+ await renderWithApp(createAppTestDouble({
140
+ user: {
141
+ isRestricted: true,
142
+ isAnonymous: true,
143
+ currentSession: { getTokens: vitest.vi.fn(async () => ({ refreshToken: "anonymous-refresh-token" })) }
144
+ },
145
+ sendRequest,
146
+ redirectToSignUp
147
+ }));
148
+ await (0, react.act)(async () => {
149
+ getButton("authorize").click();
150
+ });
151
+ (0, vitest.expect)(redirectToSignUp).toHaveBeenCalledWith({ replace: true });
152
+ (0, vitest.expect)(sessionStorage.getItem("hexclave-cli-auth-confirmed")).toBe("login-code");
153
+ (0, vitest.expect)(sendRequest).not.toHaveBeenCalled();
154
+ });
113
155
  (0, vitest.it)("ignores duplicate authorize clicks before React re-renders", async () => {
114
156
  window.history.replaceState({}, "", "/handler/cli-auth-confirm?login_code=login-code");
115
157
  const getTokens = vitest.vi.fn(async () => ({ refreshToken: "refresh-token" }));
@@ -1 +1 @@
1
- {"version":3,"file":"cli-auth-confirm.test.js","names":["vi","hexclaveAppInternalsSymbol","HexclaveContext"],"sources":["../../src/components-page/cli-auth-confirm.test.tsx"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n// @vitest-environment jsdom\n\nimport { runAsynchronously } from \"@hexclave/shared/dist/utils/promises\";\nimport React, { act } from \"react\";\nimport { createRoot, type Root } from \"react-dom/client\";\nimport { afterEach, beforeEach, describe, expect, it, vi } from \"vitest\";\nimport type { StackClientApp } from \"../lib/hexclave-app/apps/interfaces/client-app\";\nimport { hexclaveAppInternalsSymbol } from \"../lib/hexclave-app/common\";\nimport { HexclaveContext } from \"../providers/hexclave-context\";\nimport { useCliAuthConfirmation } from \"./cli-auth-confirm\";\n\nconst previousActEnvironment = Reflect.get(globalThis, \"IS_REACT_ACT_ENVIRONMENT\");\n\nfunction responseJson(data: unknown, init?: ResponseInit) {\n return new Response(JSON.stringify(data), {\n status: init?.status ?? 200,\n headers: { \"Content-Type\": \"application/json\" },\n });\n}\n\nfunction createAppTestDouble(options: {\n user: unknown,\n sendRequest: (path: string, requestOptions: RequestInit) => Promise<Response>,\n signInWithTokens?: (tokens: { accessToken: string, refreshToken: string }) => Promise<void>,\n redirectToSignIn?: (options: { replace: true }) => Promise<void>,\n redirectToSignUp?: (options: { replace: true }) => Promise<void>,\n}) {\n const app = {\n useUser: () => options.user,\n redirectToSignIn: options.redirectToSignIn ?? vi.fn(async () => {}),\n redirectToSignUp: options.redirectToSignUp ?? vi.fn(async () => {}),\n [hexclaveAppInternalsSymbol]: {\n sendRequest: options.sendRequest,\n signInWithTokens: options.signInWithTokens ?? vi.fn(async () => {}),\n },\n };\n\n // This test double intentionally implements only the StackClientApp surface\n // that useCliAuthConfirmation touches.\n return app as unknown as StackClientApp<true>;\n}\n\nfunction HookProbe() {\n const cliAuth = useCliAuthConfirmation();\n return (\n <>\n <div data-testid=\"status\">{cliAuth.status}</div>\n <div data-testid=\"error\">{cliAuth.error?.message}</div>\n <button type=\"button\" onClick={() => runAsynchronously(cliAuth.authorize)}>authorize</button>\n <button onClick={cliAuth.retry}>retry</button>\n </>\n );\n}\n\nlet root: Root | null = null;\nlet container: HTMLDivElement | null = null;\n\nasync function renderWithApp(app: StackClientApp<true>) {\n container = document.createElement(\"div\");\n document.body.append(container);\n root = createRoot(container);\n await act(async () => {\n root?.render(\n <HexclaveContext.Provider value={{ app }}>\n <HookProbe />\n </HexclaveContext.Provider>\n );\n });\n}\n\nfunction getByTestId(testId: string): HTMLElement {\n const element = container?.querySelector(`[data-testid=\"${testId}\"]`);\n if (!(element instanceof HTMLElement)) {\n throw new Error(`Could not find test element ${testId}`);\n }\n return element;\n}\n\nfunction getButton(label: string): HTMLButtonElement {\n const button = [...container?.querySelectorAll(\"button\") ?? []]\n .find((element) => element.textContent === label);\n if (!(button instanceof HTMLButtonElement)) {\n throw new Error(`Could not find button ${label}`);\n }\n return button;\n}\n\ndescribe(\"useCliAuthConfirmation\", () => {\n beforeEach(() => {\n Reflect.set(globalThis, \"IS_REACT_ACT_ENVIRONMENT\", true);\n });\n\n afterEach(() => {\n act(() => {\n root?.unmount();\n });\n container?.remove();\n root = null;\n container = null;\n vi.restoreAllMocks();\n window.history.replaceState({}, \"\", \"/\");\n Reflect.set(globalThis, \"IS_REACT_ACT_ENVIRONMENT\", previousActEnvironment);\n });\n\n it(\"completes CLI auth with the current user's refresh token\", async () => {\n window.history.replaceState({}, \"\", \"/handler/cli-auth-confirm?login_code=login-code\");\n const getTokens = vi.fn(async () => ({ refreshToken: \"refresh-token\" }));\n const sendRequest = vi.fn(async (_path: string, _requestOptions: RequestInit) => new Response(null, { status: 200 }));\n const app = createAppTestDouble({\n user: { currentSession: { getTokens } },\n sendRequest,\n });\n\n await renderWithApp(app);\n await act(async () => {\n getButton(\"authorize\").click();\n });\n\n expect(getByTestId(\"status\").textContent).toBe(\"success\");\n expect(getTokens).toHaveBeenCalledOnce();\n expect(sendRequest).toHaveBeenCalledOnce();\n expect(sendRequest.mock.calls[0][0]).toBe(\"/auth/cli/complete\");\n expect(JSON.parse(String(sendRequest.mock.calls[0][1].body))).toMatchInlineSnapshot(`\n {\n \"login_code\": \"login-code\",\n \"refresh_token\": \"refresh-token\",\n }\n `);\n });\n\n it(\"ignores duplicate authorize clicks before React re-renders\", async () => {\n window.history.replaceState({}, \"\", \"/handler/cli-auth-confirm?login_code=login-code\");\n const getTokens = vi.fn(async () => ({ refreshToken: \"refresh-token\" }));\n const sendRequest = vi.fn(async (_path: string, _requestOptions: RequestInit) => new Response(null, { status: 200 }));\n const app = createAppTestDouble({\n user: { currentSession: { getTokens } },\n sendRequest,\n });\n\n await renderWithApp(app);\n await act(async () => {\n const authorizeButton = getButton(\"authorize\");\n authorizeButton.click();\n authorizeButton.click();\n });\n\n expect(sendRequest).toHaveBeenCalledOnce();\n });\n\n it(\"claims anonymous CLI sessions before redirecting to sign-up\", async () => {\n window.history.replaceState({}, \"\", \"/handler/cli-auth-confirm?login_code=login-code\");\n const signInWithTokens = vi.fn(async (_tokens: { accessToken: string, refreshToken: string }) => {});\n const redirectToSignUp = vi.fn(async (_options: { replace: true }) => {});\n const sendRequest = vi.fn(async (_path: string, _requestOptions: RequestInit) => new Response(null, { status: 200 }))\n .mockResolvedValueOnce(responseJson({ cli_session_state: \"anonymous\" }))\n .mockResolvedValueOnce(responseJson({ access_token: \"access-token\", refresh_token: \"refresh-token\" }));\n const app = createAppTestDouble({\n user: null,\n sendRequest,\n signInWithTokens,\n redirectToSignUp,\n });\n\n await renderWithApp(app);\n await act(async () => {\n getButton(\"authorize\").click();\n });\n\n expect(redirectToSignUp).toHaveBeenCalledWith({ replace: true });\n expect(signInWithTokens).toHaveBeenCalledWith({\n accessToken: \"access-token\",\n refreshToken: \"refresh-token\",\n });\n expect(sessionStorage.getItem(\"hexclave-cli-auth-confirmed\")).toBe(\"login-code\");\n expect(sendRequest.mock.calls.map(call => JSON.parse(String(call[1].body)))).toMatchInlineSnapshot(`\n [\n {\n \"login_code\": \"login-code\",\n \"mode\": \"check\",\n },\n {\n \"login_code\": \"login-code\",\n \"mode\": \"claim-anon-session\",\n },\n ]\n `);\n });\n\n it(\"reports invalid when the login code is missing\", async () => {\n window.history.replaceState({}, \"\", \"/handler/cli-auth-confirm\");\n const app = createAppTestDouble({\n user: null,\n sendRequest: vi.fn(async (_path: string, _requestOptions: RequestInit) => new Response(null, { status: 200 })),\n });\n\n await renderWithApp(app);\n\n expect(getByTestId(\"status\").textContent).toBe(\"invalid\");\n });\n});\n"],"mappings":";;;;;;;;;;;;AAeA,MAAM,yBAAyB,QAAQ,IAAI,YAAY,0BAA0B;AAEjF,SAAS,aAAa,MAAe,MAAqB;CACxD,OAAO,IAAI,SAAS,KAAK,UAAU,IAAI,GAAG;EACxC,QAAQ,MAAM,UAAU;EACxB,SAAS,EAAE,gBAAgB,mBAAmB;CAChD,CAAC;AACH;AAEA,SAAS,oBAAoB,SAM1B;CAaD,OAAO;EAXL,eAAe,QAAQ;EACvB,kBAAkB,QAAQ,oBAAoBA,OAAAA,GAAG,GAAG,YAAY,CAAC,CAAC;EAClE,kBAAkB,QAAQ,oBAAoBA,OAAAA,GAAG,GAAG,YAAY,CAAC,CAAC;GACjEC,8BAAAA,6BAA6B;GAC5B,aAAa,QAAQ;GACrB,kBAAkB,QAAQ,oBAAoBD,OAAAA,GAAG,GAAG,YAAY,CAAC,CAAC;EACpE;CAKO;AACX;AAEA,SAAS,YAAY;CACnB,MAAM,WAAA,GAAA,sBAAA,uBAAA,CAAiC;CACvC,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA;EACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,eAAY;aAAU,QAAQ;EAAY,CAAA;EAC/C,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,eAAY;aAAS,QAAQ,OAAO;EAAa,CAAA;EACtD,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;GAAQ,MAAK;GAAS,gBAAA,GAAA,qCAAA,kBAAA,CAAiC,QA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AAQ,6BAA6B,CAAC,CAAC,CAAC,KAAK,YAAY;EAC/E,CAAA,GAAA,OAAA,OAAA,CAAO,YAAY,KAAK,MAAM,KAAI,SAAQ,KAAK,MAAM,OAAO,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,sBAAsB;;;;;;;;;;;KAWlG;CACH,CAAC;CAED,CAAA,GAAA,OAAA,GAAA,CAAG,kDAAkD,YAAY;EAC/D,OAAO,QAAQ,aAAa,CAAC,GAAG,IAAI,2BAA2B;EAM/D,MAAM,cALM,oBAAoB;GAC9B,MAAM;GACN,aAAaA,OAAAA,GAAG,GAAG,OAAO,OAAe,oBAAiC,IAAI,SAAS,MAAM,EAAE,QAAQ,IAAI,CAAC,CAAC;EAC/G,CAEsB,CAAC;EAEvB,CAAA,GAAA,OAAA,OAAA,CAAO,YAAY,QAAQ,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,SAAS;CAC1D,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"cli-auth-confirm.test.js","names":["vi","hexclaveAppInternalsSymbol","HexclaveContext"],"sources":["../../src/components-page/cli-auth-confirm.test.tsx"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n// @vitest-environment jsdom\n\nimport { runAsynchronously } from \"@hexclave/shared/dist/utils/promises\";\nimport React, { act } from \"react\";\nimport { createRoot, type Root } from \"react-dom/client\";\nimport { afterEach, beforeEach, describe, expect, it, vi } from \"vitest\";\nimport type { StackClientApp } from \"../lib/hexclave-app/apps/interfaces/client-app\";\nimport { hexclaveAppInternalsSymbol } from \"../lib/hexclave-app/common\";\nimport { HexclaveContext } from \"../providers/hexclave-context\";\nimport { useCliAuthConfirmation } from \"./cli-auth-confirm\";\n\nconst previousActEnvironment = Reflect.get(globalThis, \"IS_REACT_ACT_ENVIRONMENT\");\n\nfunction responseJson(data: unknown, init?: ResponseInit) {\n return new Response(JSON.stringify(data), {\n status: init?.status ?? 200,\n headers: { \"Content-Type\": \"application/json\" },\n });\n}\n\nfunction createAppTestDouble(options: {\n user: unknown,\n sendRequest: (path: string, requestOptions: RequestInit) => Promise<Response>,\n signInWithTokens?: (tokens: { accessToken: string, refreshToken: string }) => Promise<void>,\n redirectToSignIn?: (options: { replace: true }) => Promise<void>,\n redirectToSignUp?: (options: { replace: true }) => Promise<void>,\n redirectToOnboarding?: (options: { replace: true }) => Promise<void>,\n}) {\n const app = {\n useUser: () => options.user,\n redirectToSignIn: options.redirectToSignIn ?? vi.fn(async () => {}),\n redirectToSignUp: options.redirectToSignUp ?? vi.fn(async () => {}),\n redirectToOnboarding: options.redirectToOnboarding ?? vi.fn(async () => {}),\n [hexclaveAppInternalsSymbol]: {\n sendRequest: options.sendRequest,\n signInWithTokens: options.signInWithTokens ?? vi.fn(async () => {}),\n },\n };\n\n // This test double intentionally implements only the StackClientApp surface\n // that useCliAuthConfirmation touches.\n return app as unknown as StackClientApp<true>;\n}\n\nfunction HookProbe() {\n const cliAuth = useCliAuthConfirmation();\n return (\n <>\n <div data-testid=\"status\">{cliAuth.status}</div>\n <div data-testid=\"error\">{cliAuth.error?.message}</div>\n <button type=\"button\" onClick={() => runAsynchronously(cliAuth.authorize)}>authorize</button>\n <button onClick={cliAuth.retry}>retry</button>\n </>\n );\n}\n\nlet root: Root | null = null;\nlet container: HTMLDivElement | null = null;\n\nasync function renderWithApp(app: StackClientApp<true>) {\n container = document.createElement(\"div\");\n document.body.append(container);\n root = createRoot(container);\n await act(async () => {\n root?.render(\n <HexclaveContext.Provider value={{ app }}>\n <HookProbe />\n </HexclaveContext.Provider>\n );\n });\n}\n\nfunction getByTestId(testId: string): HTMLElement {\n const element = container?.querySelector(`[data-testid=\"${testId}\"]`);\n if (!(element instanceof HTMLElement)) {\n throw new Error(`Could not find test element ${testId}`);\n }\n return element;\n}\n\nfunction getButton(label: string): HTMLButtonElement {\n const button = [...container?.querySelectorAll(\"button\") ?? []]\n .find((element) => element.textContent === label);\n if (!(button instanceof HTMLButtonElement)) {\n throw new Error(`Could not find button ${label}`);\n }\n return button;\n}\n\ndescribe(\"useCliAuthConfirmation\", () => {\n beforeEach(() => {\n Reflect.set(globalThis, \"IS_REACT_ACT_ENVIRONMENT\", true);\n });\n\n afterEach(() => {\n act(() => {\n root?.unmount();\n });\n container?.remove();\n root = null;\n container = null;\n vi.restoreAllMocks();\n sessionStorage.clear();\n window.history.replaceState({}, \"\", \"/\");\n Reflect.set(globalThis, \"IS_REACT_ACT_ENVIRONMENT\", previousActEnvironment);\n });\n\n it(\"completes CLI auth with the current user's refresh token\", async () => {\n window.history.replaceState({}, \"\", \"/handler/cli-auth-confirm?login_code=login-code\");\n const getTokens = vi.fn(async () => ({ refreshToken: \"refresh-token\" }));\n const sendRequest = vi.fn(async (_path: string, _requestOptions: RequestInit) => new Response(null, { status: 200 }));\n const app = createAppTestDouble({\n user: { currentSession: { getTokens } },\n sendRequest,\n });\n\n await renderWithApp(app);\n await act(async () => {\n getButton(\"authorize\").click();\n });\n\n expect(getByTestId(\"status\").textContent).toBe(\"success\");\n expect(getTokens).toHaveBeenCalledOnce();\n expect(sendRequest).toHaveBeenCalledOnce();\n expect(sendRequest.mock.calls[0][0]).toBe(\"/auth/cli/complete\");\n expect(JSON.parse(String(sendRequest.mock.calls[0][1].body))).toMatchInlineSnapshot(`\n {\n \"login_code\": \"login-code\",\n \"refresh_token\": \"refresh-token\",\n }\n `);\n });\n\n it(\"redirects restricted users to onboarding without completing CLI auth\", async () => {\n window.history.replaceState({}, \"\", \"/handler/cli-auth-confirm?login_code=login-code\");\n const redirectToOnboarding = vi.fn(async (_options: { replace: true }) => {});\n const sendRequest = vi.fn(async (_path: string, _requestOptions: RequestInit) => new Response(null, { status: 200 }));\n const app = createAppTestDouble({\n user: {\n isRestricted: true,\n isAnonymous: false,\n currentSession: {\n getTokens: vi.fn(async () => ({ refreshToken: \"restricted-refresh-token\" })),\n },\n },\n sendRequest,\n redirectToOnboarding,\n });\n\n await renderWithApp(app);\n await act(async () => {\n getButton(\"authorize\").click();\n });\n\n expect(redirectToOnboarding).toHaveBeenCalledWith({ replace: true });\n expect(sessionStorage.getItem(\"hexclave-cli-auth-confirmed\")).toBe(\"login-code\");\n expect(sendRequest).not.toHaveBeenCalled();\n });\n\n it(\"redirects anonymous users to sign-up without completing CLI auth\", async () => {\n window.history.replaceState({}, \"\", \"/handler/cli-auth-confirm?login_code=login-code\");\n const redirectToSignUp = vi.fn(async (_options: { replace: true }) => {});\n const sendRequest = vi.fn(async (_path: string, _requestOptions: RequestInit) => new Response(null, { status: 200 }));\n const app = createAppTestDouble({\n user: {\n isRestricted: true,\n isAnonymous: true,\n currentSession: {\n getTokens: vi.fn(async () => ({ refreshToken: \"anonymous-refresh-token\" })),\n },\n },\n sendRequest,\n redirectToSignUp,\n });\n\n await renderWithApp(app);\n await act(async () => {\n getButton(\"authorize\").click();\n });\n\n expect(redirectToSignUp).toHaveBeenCalledWith({ replace: true });\n expect(sessionStorage.getItem(\"hexclave-cli-auth-confirmed\")).toBe(\"login-code\");\n expect(sendRequest).not.toHaveBeenCalled();\n });\n\n it(\"ignores duplicate authorize clicks before React re-renders\", async () => {\n window.history.replaceState({}, \"\", \"/handler/cli-auth-confirm?login_code=login-code\");\n const getTokens = vi.fn(async () => ({ refreshToken: \"refresh-token\" }));\n const sendRequest = vi.fn(async (_path: string, _requestOptions: RequestInit) => new Response(null, { status: 200 }));\n const app = createAppTestDouble({\n user: { currentSession: { getTokens } },\n sendRequest,\n });\n\n await renderWithApp(app);\n await act(async () => {\n const authorizeButton = getButton(\"authorize\");\n authorizeButton.click();\n authorizeButton.click();\n });\n\n expect(sendRequest).toHaveBeenCalledOnce();\n });\n\n it(\"claims anonymous CLI sessions before redirecting to sign-up\", async () => {\n window.history.replaceState({}, \"\", \"/handler/cli-auth-confirm?login_code=login-code\");\n const signInWithTokens = vi.fn(async (_tokens: { accessToken: string, refreshToken: string }) => {});\n const redirectToSignUp = vi.fn(async (_options: { replace: true }) => {});\n const sendRequest = vi.fn(async (_path: string, _requestOptions: RequestInit) => new Response(null, { status: 200 }))\n .mockResolvedValueOnce(responseJson({ cli_session_state: \"anonymous\" }))\n .mockResolvedValueOnce(responseJson({ access_token: \"access-token\", refresh_token: \"refresh-token\" }));\n const app = createAppTestDouble({\n user: null,\n sendRequest,\n signInWithTokens,\n redirectToSignUp,\n });\n\n await renderWithApp(app);\n await act(async () => {\n getButton(\"authorize\").click();\n });\n\n expect(redirectToSignUp).toHaveBeenCalledWith({ replace: true });\n expect(signInWithTokens).toHaveBeenCalledWith({\n accessToken: \"access-token\",\n refreshToken: \"refresh-token\",\n });\n expect(sessionStorage.getItem(\"hexclave-cli-auth-confirmed\")).toBe(\"login-code\");\n expect(sendRequest.mock.calls.map(call => JSON.parse(String(call[1].body)))).toMatchInlineSnapshot(`\n [\n {\n \"login_code\": \"login-code\",\n \"mode\": \"check\",\n },\n {\n \"login_code\": \"login-code\",\n \"mode\": \"claim-anon-session\",\n },\n ]\n `);\n });\n\n it(\"reports invalid when the login code is missing\", async () => {\n window.history.replaceState({}, \"\", \"/handler/cli-auth-confirm\");\n const app = createAppTestDouble({\n user: null,\n sendRequest: vi.fn(async (_path: string, _requestOptions: RequestInit) => new Response(null, { status: 200 })),\n });\n\n await renderWithApp(app);\n\n expect(getByTestId(\"status\").textContent).toBe(\"invalid\");\n });\n});\n"],"mappings":";;;;;;;;;;;;AAeA,MAAM,yBAAyB,QAAQ,IAAI,YAAY,0BAA0B;AAEjF,SAAS,aAAa,MAAe,MAAqB;CACxD,OAAO,IAAI,SAAS,KAAK,UAAU,IAAI,GAAG;EACxC,QAAQ,MAAM,UAAU;EACxB,SAAS,EAAE,gBAAgB,mBAAmB;CAChD,CAAC;AACH;AAEA,SAAS,oBAAoB,SAO1B;CAcD,OAAO;EAZL,eAAe,QAAQ;EACvB,kBAAkB,QAAQ,oBAAoBA,OAAAA,G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K,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,sBAAsB;;;;;;;;;;;KAWlG;CACH,CAAC;CAED,CAAA,GAAA,OAAA,GAAA,CAAG,kDAAkD,YAAY;EAC/D,OAAO,QAAQ,aAAa,CAAC,GAAG,IAAI,2BAA2B;EAM/D,MAAM,cALM,oBAAoB;GAC9B,MAAM;GACN,aAAaA,OAAAA,GAAG,GAAG,OAAO,OAAe,oBAAiC,IAAI,SAAS,MAAM,EAAE,QAAQ,IAAI,CAAC,CAAC;EAC/G,CAEsB,CAAC;EAEvB,CAAA,GAAA,OAAA,OAAA,CAAO,YAAY,QAAQ,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,SAAS;CAC1D,CAAC;AACH,CAAC"}
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ let _hexclave_shared_dist_utils_promises = require("@hexclave/shared/dist/utils/promises");
3
4
  let _hookform_resolvers_yup = require("@hookform/resolvers/yup");
4
5
  let _hexclave_shared_dist_schema_fields = require("@hexclave/shared/dist/schema-fields");
5
- let _hexclave_shared_dist_utils_promises = require("@hexclave/shared/dist/utils/promises");
6
6
  let _hexclave_ui = require("@hexclave/ui");
7
7
  let react = require("react");
8
8
  let react_hook_form = require("react-hook-form");
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- let _hexclave_shared_dist_utils_errors = require("@hexclave/shared/dist/utils/errors");
4
3
  let _hexclave_shared_dist_utils_promises = require("@hexclave/shared/dist/utils/promises");
4
+ let ___lib_hexclave_app_common_js = require("../lib/hexclave-app/common.js");
5
+ let _hexclave_shared_dist_utils_errors = require("@hexclave/shared/dist/utils/errors");
5
6
  let _hexclave_ui = require("@hexclave/ui");
6
7
  let react = require("react");
7
8
  let ___index_js = require("../index.js");
8
9
  let ___lib_translations_js = require("../lib/translations.js");
9
10
  let react_jsx_runtime = require("react/jsx-runtime");
10
11
  let _hexclave_shared = require("@hexclave/shared");
11
- let ___lib_hexclave_app_common_js = require("../lib/hexclave-app/common.js");
12
12
  let ___components_elements_maybe_full_page_js = require("../components/elements/maybe-full-page.js");
13
13
  let ___components_link_js = require("../components/link.js");
14
14
  let __error_page_js = require("./error-page.js");
@@ -1,9 +1,9 @@
1
1
  const require_rolldown_runtime = require("../rolldown-runtime-D6vf50IK.js");
2
+ let ___lib_hexclave_app_common_js = require("../lib/hexclave-app/common.js");
2
3
  let react = require("react");
3
4
  react = require_rolldown_runtime.__toESM(react);
4
5
  let react_jsx_runtime = require("react/jsx-runtime");
5
6
  let _hexclave_shared = require("@hexclave/shared");
6
- let ___lib_hexclave_app_common_js = require("../lib/hexclave-app/common.js");
7
7
  let react_dom_client = require("react-dom/client");
8
8
  let vitest = require("vitest");
9
9
  let __oauth_callback_js = require("./oauth-callback.js");
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ let _hexclave_shared_dist_utils_promises = require("@hexclave/shared/dist/utils/promises");
3
4
  let _hookform_resolvers_yup = require("@hookform/resolvers/yup");
4
5
  let _hexclave_shared_dist_schema_fields = require("@hexclave/shared/dist/schema-fields");
5
- let _hexclave_shared_dist_utils_promises = require("@hexclave/shared/dist/utils/promises");
6
6
  let _hexclave_ui = require("@hexclave/ui");
7
7
  let react = require("react");
8
8
  let react_hook_form = require("react-hook-form");
@@ -4,9 +4,9 @@ Object.defineProperties(exports, {
4
4
  [Symbol.toStringTag]: { value: "Module" }
5
5
  });
6
6
  const require_rolldown_runtime = require("../rolldown-runtime-D6vf50IK.js");
7
+ let _hexclave_shared_dist_utils_promises = require("@hexclave/shared/dist/utils/promises");
7
8
  let _hookform_resolvers_yup = require("@hookform/resolvers/yup");
8
9
  let _hexclave_shared_dist_schema_fields = require("@hexclave/shared/dist/schema-fields");
9
- let _hexclave_shared_dist_utils_promises = require("@hexclave/shared/dist/utils/promises");
10
10
  let _hexclave_ui = require("@hexclave/ui");
11
11
  let react = require("react");
12
12
  let react_hook_form = require("react-hook-form");
@@ -1,8 +1,8 @@
1
1
  const require_rolldown_runtime = require("../rolldown-runtime-D6vf50IK.js");
2
+ let ___lib_hexclave_app_common_js = require("../lib/hexclave-app/common.js");
2
3
  let react = require("react");
3
4
  react = require_rolldown_runtime.__toESM(react);
4
5
  let react_jsx_runtime = require("react/jsx-runtime");
5
- let ___lib_hexclave_app_common_js = require("../lib/hexclave-app/common.js");
6
6
  let react_dom_client = require("react-dom/client");
7
7
  let vitest = require("vitest");
8
8
  let __sign_out_js = require("./sign-out.js");
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ let _hexclave_shared_dist_utils_promises = require("@hexclave/shared/dist/utils/promises");
3
4
  let _hookform_resolvers_yup = require("@hookform/resolvers/yup");
4
5
  let _hexclave_shared_dist_schema_fields = require("@hexclave/shared/dist/schema-fields");
5
- let _hexclave_shared_dist_utils_promises = require("@hexclave/shared/dist/utils/promises");
6
6
  let _hexclave_ui = require("@hexclave/ui");
7
7
  let react = require("react");
8
8
  let react_hook_form = require("react-hook-form");
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- let _hexclave_shared_dist_utils_promises = require("@hexclave/shared/dist/utils/promises");
3
2
  let _hexclave_shared_dist_utils_dev_tool = require("@hexclave/shared/dist/utils/dev-tool");
3
+ let _hexclave_shared_dist_utils_promises = require("@hexclave/shared/dist/utils/promises");
4
4
  let ___in_page_ui_dom_js = require("../in-page-ui/dom.js");
5
5
  let ___lib_hexclave_app_common_js = require("../lib/hexclave-app/common.js");
6
6
  let _hexclave_shared_dist_utils_urls = require("@hexclave/shared/dist/utils/urls");
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- let _hexclave_shared_dist_utils_errors = require("@hexclave/shared/dist/utils/errors");
3
2
  let _hexclave_shared_dist_utils_promises = require("@hexclave/shared/dist/utils/promises");
4
3
  let ___in_page_ui_dom_js = require("../in-page-ui/dom.js");
4
+ let _hexclave_shared_dist_utils_errors = require("@hexclave/shared/dist/utils/errors");
5
5
  let _hexclave_shared_dist_utils_urls = require("@hexclave/shared/dist/utils/urls");
6
6
  let ___generated_env_js = require("../generated/env.js");
7
7
  //#region src/dev-tool/index.ts
@@ -1,9 +1,9 @@
1
- import { runAsynchronously } from "@hexclave/shared/dist/utils/promises";
2
1
  import { AnalyticsClickmapResponseBodySchema } from "@hexclave/shared/dist/interface/admin-metrics";
3
2
  import { CLICKMAP_OVERLAY_RESUME_STORAGE_KEY, CLICKMAP_OVERLAY_TOKEN_STORAGE_KEY, CLICKMAP_OVERLAY_TOKEN_UPDATED_EVENT } from "@hexclave/shared/dist/utils/analytics-clickmap-overlay";
4
3
  import { CLICKMAP_ROOT_ID, DEV_TOOL_ROOT_ID } from "@hexclave/shared/dist/utils/dev-tool";
5
4
  import { cssEscapeIdent } from "@hexclave/shared/dist/utils/dom";
6
5
  import { buildElementsChain, parseElementsChain } from "@hexclave/shared/dist/utils/elements-chain";
6
+ import { runAsynchronously } from "@hexclave/shared/dist/utils/promises";
7
7
  import { stringCompare } from "@hexclave/shared/dist/utils/strings";
8
8
  import { getGlobalUiInstance, h, hasAppendChild, setGlobalUiInstance, setHtml } from "../in-page-ui/dom.js";
9
9
  import { hexclaveAppInternalsSymbol } from "../lib/hexclave-app/common.js";
@@ -1,7 +1,7 @@
1
- import { captureError } from "@hexclave/shared/dist/utils/errors";
2
- import { runAsynchronously } from "@hexclave/shared/dist/utils/promises";
3
1
  import { CLICKMAP_OVERLAY_RESUME_STORAGE_KEY, CLICKMAP_OVERLAY_TOKEN_UPDATED_EVENT } from "@hexclave/shared/dist/utils/analytics-clickmap-overlay";
2
+ import { runAsynchronously } from "@hexclave/shared/dist/utils/promises";
4
3
  import { canMountIntoDom } from "../in-page-ui/dom.js";
4
+ import { captureError } from "@hexclave/shared/dist/utils/errors";
5
5
  //#region src/clickmap/index.ts
6
6
  function consumeResumeSentinel() {
7
7
  try {
@@ -1,8 +1,8 @@
1
1
  "use client";
2
+ import { runAsynchronously } from "@hexclave/shared/dist/utils/promises";
3
+ import { captureError } from "@hexclave/shared/dist/utils/errors";
2
4
  import { yupResolver } from "@hookform/resolvers/yup";
3
5
  import { yupObject, yupString } from "@hexclave/shared/dist/schema-fields";
4
- import { captureError } from "@hexclave/shared/dist/utils/errors";
5
- import { runAsynchronously } from "@hexclave/shared/dist/utils/promises";
6
6
  import { ActionDialog, Button, CopyField, Input, Label, Typography } from "@hexclave/ui";
7
7
  import { useState } from "react";
8
8
  import { useForm } from "react-hook-form";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
+ import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
2
3
  import { yupResolver } from "@hookform/resolvers/yup";
3
4
  import { passwordSchema, strictEmailSchema, yupObject } from "@hexclave/shared/dist/schema-fields";
4
- import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
5
5
  import { Button, Input, Label, PasswordInput } from "@hexclave/ui";
6
6
  import { useState } from "react";
7
7
  import { useForm } from "react-hook-form";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
+ import { runAsynchronously, runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
2
3
  import { yupResolver } from "@hookform/resolvers/yup";
3
4
  import { passwordSchema, strictEmailSchema, yupObject } from "@hexclave/shared/dist/schema-fields";
4
- import { runAsynchronously, runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
5
5
  import { Button, Input, Label, PasswordInput } from "@hexclave/ui";
6
6
  import { useState } from "react";
7
7
  import { useForm } from "react-hook-form";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
+ import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
2
3
  import { yupResolver } from "@hookform/resolvers/yup";
3
4
  import { strictEmailSchema, yupObject } from "@hexclave/shared/dist/schema-fields";
4
- import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
5
5
  import { Button, Input, InputOTP, InputOTPGroup, InputOTPSlot, Label, Typography } from "@hexclave/ui";
6
6
  import { useEffect, useState } from "react";
7
7
  import { useForm } from "react-hook-form";
@@ -0,0 +1,13 @@
1
+ //#region src/components/message-cards/no-auth-methods-message-card.d.ts
2
+ /**
3
+ * Shown instead of the sign-in/sign-up form when a project has no auth methods at all (no password, no
4
+ * OTP, no passkey, no OAuth provider). Without this, the page would look broken: there is nothing the end
5
+ * user can do, and the developer gets no hint about what went wrong or how to fix it.
6
+ */
7
+ declare function NoAuthMethodsMessageCard(props: {
8
+ fullPage?: boolean;
9
+ projectDisplayName?: string;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ //#endregion
12
+ export { NoAuthMethodsMessageCard };
13
+ //# sourceMappingURL=no-auth-methods-message-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-auth-methods-message-card.d.ts","names":[],"sources":["../../../../src/components/message-cards/no-auth-methods-message-card.tsx"],"mappings":";;AAsBA;;;;iBAAgB,wBAAA,CAAyB,KAAA;EACvC,QAAA;EACA,kBAAA;AAAA,gCACD,GAAA,CAAA,OAAA"}
@@ -0,0 +1,74 @@
1
+ "use client";
2
+ import { Typography } from "@hexclave/ui";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { KeyRound } from "lucide-react";
5
+ import { MaybeFullPage } from "../elements/maybe-full-page.js";
6
+ import { useTranslation } from "../../lib/translations.js";
7
+ //#region src/components/message-cards/no-auth-methods-message-card.tsx
8
+ const configSnippet = `auth: {
9
+ password: { allowSignIn: true },
10
+ otp: { allowSignIn: true },
11
+ }`;
12
+ /**
13
+ * Shown instead of the sign-in/sign-up form when a project has no auth methods at all (no password, no
14
+ * OTP, no passkey, no OAuth provider). Without this, the page would look broken: there is nothing the end
15
+ * user can do, and the developer gets no hint about what went wrong or how to fix it.
16
+ */
17
+ function NoAuthMethodsMessageCard(props) {
18
+ const { t } = useTranslation();
19
+ return /* @__PURE__ */ jsx(MaybeFullPage, {
20
+ fullPage: !!props.fullPage,
21
+ children: /* @__PURE__ */ jsxs("div", {
22
+ className: "stack-scope flex flex-col items-stretch",
23
+ style: {
24
+ maxWidth: "380px",
25
+ flexBasis: "380px",
26
+ padding: props.fullPage ? "1rem" : 0
27
+ },
28
+ children: [/* @__PURE__ */ jsxs("div", {
29
+ className: "flex flex-col items-center text-center",
30
+ children: [
31
+ /* @__PURE__ */ jsx("div", {
32
+ className: "mb-4 flex h-11 w-11 items-center justify-center rounded-2xl border border-black/[0.08] dark:border-white/[0.10]",
33
+ children: /* @__PURE__ */ jsx(KeyRound, { className: "h-5 w-5 text-gray-500" })
34
+ }),
35
+ /* @__PURE__ */ jsx(Typography, {
36
+ type: "h2",
37
+ children: t("Sign-in is not available")
38
+ }),
39
+ /* @__PURE__ */ jsx(Typography, {
40
+ type: "label",
41
+ variant: "secondary",
42
+ children: props.projectDisplayName == null ? t("This app has no authentication methods enabled, so nobody can sign in yet.") : t("{projectDisplayName} has no authentication methods enabled, so nobody can sign in yet.", { projectDisplayName: props.projectDisplayName })
43
+ })
44
+ ]
45
+ }), /* @__PURE__ */ jsxs("div", {
46
+ className: "mt-6 rounded-xl border border-black/[0.08] p-4 text-left dark:border-white/[0.10]",
47
+ children: [
48
+ /* @__PURE__ */ jsx(Typography, {
49
+ type: "label",
50
+ children: t("Are you the developer?")
51
+ }),
52
+ /* @__PURE__ */ jsx(Typography, {
53
+ type: "label",
54
+ variant: "secondary",
55
+ children: t("Enable at least one sign-in method in your hexclave.config.ts:")
56
+ }),
57
+ /* @__PURE__ */ jsx("pre", {
58
+ className: "mt-2 overflow-x-auto rounded-lg border border-black/[0.06] p-3 font-mono text-xs leading-relaxed dark:border-white/[0.08]",
59
+ children: configSnippet
60
+ }),
61
+ /* @__PURE__ */ jsx(Typography, {
62
+ type: "label",
63
+ variant: "secondary",
64
+ children: t("Or turn one on in the Hexclave dashboard, under Auth Methods.")
65
+ })
66
+ ]
67
+ })]
68
+ })
69
+ });
70
+ }
71
+ //#endregion
72
+ export { NoAuthMethodsMessageCard };
73
+
74
+ //# sourceMappingURL=no-auth-methods-message-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-auth-methods-message-card.js","names":[],"sources":["../../../../src/components/message-cards/no-auth-methods-message-card.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { Typography } from \"@hexclave/ui\";\nimport { KeyRound } from \"lucide-react\";\nimport { useTranslation } from \"../../lib/translations\";\nimport { MaybeFullPage } from \"../elements/maybe-full-page\";\n\nconst configSnippet = `auth: {\n password: { allowSignIn: true },\n otp: { allowSignIn: true },\n}`;\n\n/**\n * Shown instead of the sign-in/sign-up form when a project has no auth methods at all (no password, no\n * OTP, no passkey, no OAuth provider). Without this, the page would look broken: there is nothing the end\n * user can do, and the developer gets no hint about what went wrong or how to fix it.\n */\nexport function NoAuthMethodsMessageCard(props: {\n fullPage?: boolean,\n projectDisplayName?: string,\n}) {\n const { t } = useTranslation();\n\n return (\n <MaybeFullPage fullPage={!!props.fullPage}>\n <div className='stack-scope flex flex-col items-stretch' style={{ maxWidth: '380px', flexBasis: '380px', padding: props.fullPage ? '1rem' : 0 }}>\n <div className=\"flex flex-col items-center text-center\">\n <div className=\"mb-4 flex h-11 w-11 items-center justify-center rounded-2xl border border-black/[0.08] dark:border-white/[0.10]\">\n <KeyRound className=\"h-5 w-5 text-gray-500\" />\n </div>\n <Typography type='h2'>{t(\"Sign-in is not available\")}</Typography>\n <Typography type='label' variant='secondary'>\n {props.projectDisplayName == null\n ? t(\"This app has no authentication methods enabled, so nobody can sign in yet.\")\n : t(\"{projectDisplayName} has no authentication methods enabled, so nobody can sign in yet.\", { projectDisplayName: props.projectDisplayName })}\n </Typography>\n </div>\n\n <div className=\"mt-6 rounded-xl border border-black/[0.08] p-4 text-left dark:border-white/[0.10]\">\n <Typography type='label'>{t(\"Are you the developer?\")}</Typography>\n <Typography type='label' variant='secondary'>\n {t(\"Enable at least one sign-in method in your hexclave.config.ts:\")}\n </Typography>\n <pre className=\"mt-2 overflow-x-auto rounded-lg border border-black/[0.06] p-3 font-mono text-xs leading-relaxed dark:border-white/[0.08]\">{configSnippet}</pre>\n <Typography type='label' variant='secondary'>\n {t(\"Or turn one on in the Hexclave dashboard, under Auth Methods.\")}\n </Typography>\n </div>\n </div>\n </MaybeFullPage>\n );\n}\n"],"mappings":";;;;;;;AAYA,MAAM,gBAAgB;;;;;;;;;AAUtB,SAAgB,yBAAyB,OAGtC;CACD,MAAM,EAAE,MAAM,eAAe;CAE7B,OACE,oBAAC,eAAD;EAAe,UAAU,CAAC,CAAC,MAAM;YAC/B,qBAAC,OAAD;GAAK,WAAU;GAA0C,OAAO;IAAE,UAAU;IAAS,WAAW;IAAS,SAAS,MAAM,WAAW,SAAS;GAAE;aAA9I,CACE,qBAAC,OAAD;IAAK,WAAU;cAAf;KACE,oBAAC,OAAD;MAAK,WAAU;gBACb,oBAAC,UAAD,EAAU,WAAU,wBAAyB,CAAA;KAC1C,CAAA;KACL,oBAAC,YAAD;MAAY,MAAK;gBAAM,EAAE,0BAA0B;KAAc,CAAA;KACjE,oBAAC,YAAD;MAAY,MAAK;MAAQ,SAAQ;gBAC9B,MAAM,sBAAsB,OACzB,EAAE,4EAA4E,IAC9E,EAAE,0FAA0F,EAAE,oBAAoB,MAAM,mBAAmB,CAAC;KACtI,CAAA;IACT;OAEL,qBAAC,OAAD;IAAK,WAAU;cAAf;KACE,oBAAC,YAAD;MAAY,MAAK;gBAAS,EAAE,wBAAwB;KAAc,CAAA;KAClE,oBAAC,YAAD;MAAY,MAAK;MAAQ,SAAQ;gBAC9B,EAAE,gEAAgE;KACzD,CAAA;KACZ,oBAAC,OAAD;MAAK,WAAU;gBAA6H;KAAmB,CAAA;KAC/J,oBAAC,YAAD;MAAY,MAAK;MAAQ,SAAQ;gBAC9B,EAAE,+DAA+D;KACxD,CAAA;IACT;KACF;;CACQ,CAAA;AAEnB"}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { HexclaveAssertionError } from "@hexclave/shared/dist/utils/errors";
3
2
  import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
3
+ import { HexclaveAssertionError } from "@hexclave/shared/dist/utils/errors";
4
4
  import { Button, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Skeleton, Typography, cn } from "@hexclave/ui";
5
5
  import { Suspense, useMemo } from "react";
6
6
  import { useStackApp, useUser } from "../index.js";
@@ -1,5 +1,5 @@
1
- import { captureError } from "@hexclave/shared/dist/utils/errors";
2
1
  import { runAsynchronously } from "@hexclave/shared/dist/utils/promises";
2
+ import { captureError } from "@hexclave/shared/dist/utils/errors";
3
3
  import { ActionCell, Badge, Button, Skeleton, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Typography } from "@hexclave/ui";
4
4
  import { useEffect, useState } from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
+ import { runAsynchronously } from "@hexclave/shared/dist/utils/promises";
1
2
  import { yupResolver } from "@hookform/resolvers/yup";
2
3
  import { strictEmailSchema, yupObject } from "@hexclave/shared/dist/schema-fields";
3
- import { runAsynchronously } from "@hexclave/shared/dist/utils/promises";
4
4
  import { ActionCell, Badge, Button, Input, Table, TableBody, TableCell, TableRow, Typography } from "@hexclave/ui";
5
5
  import { useEffect, useState } from "react";
6
6
  import { useForm } from "react-hook-form";
@@ -1,5 +1,5 @@
1
- import { throwErr } from "@hexclave/shared/dist/utils/errors";
2
1
  import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
2
+ import { throwErr } from "@hexclave/shared/dist/utils/errors";
3
3
  import { Button, Input, Typography } from "@hexclave/ui";
4
4
  import { useEffect, useState } from "react";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
+ import { runAsynchronously, runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
1
2
  import { yupResolver } from "@hookform/resolvers/yup";
2
3
  import { passwordSchema, yupObject, yupString } from "@hexclave/shared/dist/schema-fields";
3
- import { runAsynchronously, runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
4
4
  import { Button, Input, Label, PasswordInput, Typography } from "@hexclave/ui";
5
5
  import { useState } from "react";
6
6
  import { useForm } from "react-hook-form";
@@ -1,6 +1,6 @@
1
+ import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
1
2
  import { yupResolver } from "@hookform/resolvers/yup";
2
3
  import { yupObject, yupString } from "@hexclave/shared/dist/schema-fields";
3
- import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
4
4
  import { Button, Input } from "@hexclave/ui";
5
5
  import { useState } from "react";
6
6
  import { useForm } from "react-hook-form";
@@ -1,6 +1,6 @@
1
+ import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
1
2
  import { yupResolver } from "@hookform/resolvers/yup";
2
3
  import { strictEmailSchema, yupObject } from "@hexclave/shared/dist/schema-fields";
3
- import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
4
4
  import { Button, Input, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Typography } from "@hexclave/ui";
5
5
  import { useEffect, useState } from "react";
6
6
  import { useForm } from "react-hook-form";
@@ -1 +1 @@
1
- {"version":3,"file":"auth-page.d.ts","names":[],"sources":["../../../src/components-page/auth-page.tsx"],"mappings":";KA2BK,KAAA;EACH,gBAAA;EACA,QAAA;EACA,QAAA;EACA,IAAA;EACA,iBAAA;EACA,SAAA,GAAY,KAAA,CAAM,SAAS;EAC3B,WAAA;IACE,MAAA;MACE,aAAA;MACA,iBAAA;MACA,cAAA;MACA,gBAAA;MACA,cAAA;QACE,EAAA;MAAA;IAAA;EAAA;AAAA;AAAA,iBAWQ,QAAA,CAAS,KAAA,EAAO,KAAK,+BAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"auth-page.d.ts","names":[],"sources":["../../../src/components-page/auth-page.tsx"],"mappings":";KA4BK,KAAA;EACH,gBAAA;EACA,QAAA;EACA,QAAA;EACA,IAAA;EACA,iBAAA;EACA,SAAA,GAAY,KAAA,CAAM,SAAS;EAC3B,WAAA;IACE,MAAA;MACE,aAAA;MACA,iBAAA;MACA,cAAA;MACA,gBAAA;MACA,cAAA;QACE,EAAA;MAAA;IAAA;EAAA;AAAA;AAAA,iBAWQ,QAAA,CAAS,KAAA,EAAO,KAAK,+BAAA,GAAA,CAAA,OAAA"}