Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
fix(desktop): stop automatic passkey prompts (#7522)
Theo Brownef2d5fc91e303
diff --git a/apps/web/src/components/clerk/electronPasskeys.test.ts b/apps/web/src/components/clerk/electronPasskeys.test.tsnew file mode 100644index 000000000..582b801cc--- /dev/null+++ b/apps/web/src/components/clerk/electronPasskeys.test.ts@@ -0,0 +1,60 @@+import { createPasskeys } from "@clerk/electron/passkeys";+import { afterEach, describe, expect, it, vi } from "vite-plus/test";++const publicKeyOptions = {+ allowCredentials: [],+ challenge: new Uint8Array([1]),+ rpId: "clerk.t3.codes",+ timeout: 60_000,+ userVerification: "preferred" as const,+};++const stubNativePasskeys = () => {+ const get = vi.fn().mockResolvedValue({+ ok: false,+ error: { code: "cancelled", message: "user cancelled" },+ });++ vi.stubGlobal("location", { protocol: "t3code:", hostname: "app" });+ vi.stubGlobal("window", {+ PublicKeyCredential: vi.fn(),+ __clerk_internal_electron_passkeys: {+ platform: "darwin",+ electronMajor: 41,+ get,+ },+ });++ return get;+};++describe("Electron passkeys", () => {+ afterEach(() => {+ vi.unstubAllGlobals();+ });++ it("does not send an autofill request to the native bridge", async () => {+ const get = stubNativePasskeys();+ const passkeys = createPasskeys();++ const result = await passkeys.get({+ publicKeyOptions,+ conditionalUI: true,+ });++ expect(get).not.toHaveBeenCalled();+ expect(result.error).toMatchObject({ code: "passkey_operation_aborted" });+ });++ it("sends an explicit passkey request to the native bridge", async () => {+ const get = stubNativePasskeys();+ const passkeys = createPasskeys();++ await passkeys.get({+ publicKeyOptions,+ conditionalUI: false,+ });++ expect(get).toHaveBeenCalledOnce();+ });+});diff --git a/apps/web/src/main.tsx b/apps/web/src/main.tsxindex e92bd6629..6eaaca6f5 100644--- a/apps/web/src/main.tsx+++ b/apps/web/src/main.tsx@@ -1,7 +1,7 @@import React from "react";import ReactDOM from "react-dom/client";import { ClerkProvider } from "@clerk/react";-import { passkeys as electronPasskeys } from "@clerk/electron/passkeys";+import { passkeys } from "@clerk/electron/passkeys";import { ClerkProvider as ElectronClerkProvider } from "@clerk/electron/react";import { createHashHistory, createBrowserHistory } from "@tanstack/react-router";@@ -30,14 +30,9 @@ if (isElectron) {const clerkPublishableKey = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY as string | undefined;-// @clerk/electron reports passkey autofill as supported but executes the-// "quiet" autofill request as a modal prompt, so Clerk's sign-in form pops an-// OS passkey dialog the moment it mounts. Report autofill as unsupported; the-// explicit "Use passkey" button keeps working.-// Upstream: https://github.com/clerk/javascript/issues/9496-const passkeys = {- ...electronPasskeys,- isAutoFillSupported: () => Promise.resolve(false),+// First Clerk UI build containing https://github.com/clerk/javascript/pull/9500.+const electronClerkUI = {+ __internal_clerkUIVersion: "1.30.5-canary.v20260819050620",};const app = <AppRoot router={router} />;@@ -47,6 +42,7 @@ ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render({clerkPublishableKey && hasCloudPublicConfig() ? (isElectron ? (<ElectronClerkProvider+ {...electronClerkUI}appearance={clerkAppearance}publishableKey={clerkPublishableKey}passkeys={passkeys}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex f095010f0..e01222f4d 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -46,8 +46,8 @@ overrides:'@clerk/clerk-js>@solana/wallet-adapter-react': '-''@clerk/clerk-js>@solana/wallet-standard': '-''@clerk/clerk-js>@wallet-standard/core': '-'- '@clerk/electron': 0.0.33- '@clerk/electron-passkeys': 0.0.3+ '@clerk/electron': 0.0.34-canary.v20260819050620+ '@clerk/electron-passkeys': 0.0.4-canary.v20260819050620'@clerk/expo': 4.2.0'@clerk/react': 6.14.4'@clerk/shared': 4.29.2@@ -114,11 +114,11 @@ importers:apps/desktop:dependencies:'@clerk/electron':- specifier: 0.0.33- version: 0.0.33(@clerk/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])+ specifier: 0.0.34-canary.v20260819050620+ version: 0.0.34-canary.v20260819050620(@clerk/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])'@clerk/electron-passkeys':- specifier: 0.0.3- version: 0.0.3+ specifier: 0.0.4-canary.v20260819050620+ version: 0.0.4-canary.v20260819050620'@effect/platform-node':specifier: 4.0.0-beta.103version: 4.0.0-beta.103([email protected])([email protected](patch_hash=af36b7948b6f9c56623074662b51dade5699880c1a7c71245de73e13c3185fb6))([email protected])([email protected])@@ -520,8 +520,8 @@ importers:specifier: ^1.4.1'@clerk/electron':- specifier: 0.0.33- version: 0.0.33(@clerk/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])+ specifier: 0.0.34-canary.v20260819050620+ version: 0.0.34-canary.v20260819050620(@clerk/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])'@clerk/react':specifier: 6.14.4@@ -1721,35 +1721,35 @@ packages:resolution: {integrity: sha512-4i4RE+ZQ0hKDDFSRKCISQPBy07SfFeFAhBUhNj2j01Nx2n4pqV+5iyg2Vf27+NKFNkgq7kdmZGvtug24D++8WQ==}engines: {node: '>=20.9.0'}- '@clerk/[email protected]':- resolution: {integrity: sha512-oAlrd+GLqP0oREP3hNRc6yNZhXGaQgJss9iCWRQqXjpw1yZD1ZU+L+E2Gfg84vMj/NSUhxbU0Djy0RXhmeUwgg==}+ '@clerk/[email protected]':+ resolution: {integrity: sha512-avxygtEfWBD3YPkxws4lB5mL/75SQvVBMQCg+b1gjFsQInnVOgAqAv4wHR8wgUsEbXY2zEkvqaYjFSnEveC0VA==}cpu: [arm64]os: [darwin]- '@clerk/[email protected]':- resolution: {integrity: sha512-0UPAWQEni7o8gjWwd2sP97fPshJmT2w5b8eV/jOPVSP8NqIcFCm5yIFSEx1SfB53LGfzB01A4iEGi2pxiCHqyQ==}+ '@clerk/[email protected]':+ resolution: {integrity: sha512-clShldbwDcC2ek6gJT85QKsMfaPyOhEgfz61u2n3YKivbeui33XjJu261d+LO20mqDjXZy3flLGPTIh/Kii80g==}cpu: [x64]os: [darwin]- '@clerk/[email protected]':- resolution: {integrity: sha512-bbRvifm9A/gfPkwC1UyMyF9sYGEs0aen7J2kCcaOIW3K0PXcAbHtsR/gnx4dT0bjFdd21vSa2zlIdERvHc1BiA==}+ '@clerk/[email protected]':+ resolution: {integrity: sha512-alIfXJSxyeulnNeHoT4X7+qO0o9/EBhiRWMhCXwKJIbWfwzqnnVrRH1P7HfYRnDepKhqRzsUaBuYTqQzisHG+A==}cpu: [arm64]os: [win32]- '@clerk/[email protected]':- resolution: {integrity: sha512-gFaVqKlOKTF2SJ3lMwkZ0oonycQn93p1qSrp5kzzeZBeQ+tGB3gQnjXecrhQy21AzDUyWqVJJ8KrP2HRAwifWg==}+ '@clerk/[email protected]':+ resolution: {integrity: sha512-QSKKMCdV9AhOt74ls8ExdwR+2ikoLGgN2LdWIjBgNk6epJVs2L1FXVZOM0ZqfVHFSl5y7vLmlOACR6WyJ2eoLg==}cpu: [x64]os: [win32]- '@clerk/[email protected]':- resolution: {integrity: sha512-OHhIe88qDL+FxyBalXdXNHAS5eEramr6Rerp+6iNkfkjqT8rx4hHNmfpmjg5/T1/am8QfknbOBZkqoXZlCrjPg==}+ '@clerk/[email protected]':+ resolution: {integrity: sha512-zOoFEsvOrArv7p4ERNAdkGbYoD86ragDhysLG1NdxJm2jnfw+AfwxUv0FkOPZ7iNuQ0rbJaR/urxdvEwVcuKRA==}engines: {node: '>=20.9.0'}- '@clerk/[email protected]':- resolution: {integrity: sha512-lP2B7wGHwKWrCAh4zPWPfRUIHoxQ1rwG8iiFeLmI8jBjSGcSoPX1N9bIKUCWL+Z9POmC2aRn6yXvL7e9yzfEVw==}+ '@clerk/[email protected]':+ resolution: {integrity: sha512-sfKWkH2SigKcxtR+h36G1NGnmMI5xOlwvqHpr3JYcacS/uokQbeAjCCQzEeV/9zqWYtRL4et5wCD13+gWv4b6w==}engines: {node: '>=20.9.0'}peerDependencies:- '@clerk/electron-passkeys': 0.0.3+ '@clerk/electron-passkeys': 0.0.4-canary.v20260819050620electron: '>=28'electron-store: ^8.2.0react: ^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0@@ -11580,26 +11580,26 @@ snapshots:- react- react-dom- '@clerk/[email protected]':+ '@clerk/[email protected]':optional: true- '@clerk/[email protected]':+ '@clerk/[email protected]':optional: true- '@clerk/[email protected]':+ '@clerk/[email protected]':optional: true- '@clerk/[email protected]':+ '@clerk/[email protected]':optional: true- '@clerk/[email protected]':+ '@clerk/[email protected]':optionalDependencies:- '@clerk/electron-passkeys-darwin-arm64': 0.0.3- '@clerk/electron-passkeys-darwin-x64': 0.0.3- '@clerk/electron-passkeys-win32-arm64-msvc': 0.0.3- '@clerk/electron-passkeys-win32-x64-msvc': 0.0.3+ '@clerk/electron-passkeys-darwin-arm64': 0.0.4-canary.v20260819050620+ '@clerk/electron-passkeys-darwin-x64': 0.0.4-canary.v20260819050620+ '@clerk/electron-passkeys-win32-arm64-msvc': 0.0.4-canary.v20260819050620+ '@clerk/electron-passkeys-win32-x64-msvc': 0.0.4-canary.v20260819050620- '@clerk/[email protected](@clerk/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])':+ '@clerk/[email protected](@clerk/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])':dependencies:@@ -11608,7 +11608,7 @@ snapshots:react: 19.2.6tslib: 2.8.1optionalDependencies:- '@clerk/electron-passkeys': 0.0.3+ '@clerk/electron-passkeys': 0.0.4-canary.v20260819050620electron-store: 8.2.0react-dom: 19.2.6([email protected])diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlindex 64274f598..7ec8faf70 100644--- a/pnpm-workspace.yaml+++ b/pnpm-workspace.yaml@@ -25,8 +25,8 @@ allowBuilds:catalog:"@clerk/backend": 3.14.0"@clerk/clerk-js": 6.29.2- "@clerk/electron": 0.0.33- "@clerk/electron-passkeys": 0.0.3+ "@clerk/electron": 0.0.34-canary.v20260819050620+ "@clerk/electron-passkeys": 0.0.4-canary.v20260819050620"@clerk/expo": 4.2.0"@clerk/react": 6.14.4"@clerk/shared": 4.29.2@@ -55,7 +55,8 @@ catalog:minimumReleaseAgeExclude:- "@clerk/[email protected]"- "@clerk/[email protected]"- - "@clerk/[email protected]"+ - "@clerk/[email protected]"+ - "@clerk/[email protected]"- "@clerk/[email protected]"- "@clerk/[email protected]"- "@clerk/[email protected]"@@ -76,6 +77,10 @@ minimumReleaseAgeExclude:- "@legendapp/[email protected]"+ - "@clerk/[email protected]"+ - "@clerk/[email protected]"+ - "@clerk/[email protected]"+ - "@clerk/[email protected]"overrides:"@clerk/backend": "catalog:"