Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): stop automatic passkey prompts #7522

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/7522/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 4 changed files with 73 additions and 12 deletions.

x
0 of 4 viewed, 4 left
60 additions and 0 deletionsapps/web/src/components/clerk/electronPasskeys.test.tsAdded
View file
@@ -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;
+};
+​