@devries-cameron20 / t3code-1 / commits / cb58dfd645
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

refactor(shared): remove unused Clerk hostname predicate (#10008)

Julius Marminge committed Sep 5, 2026 at 00:41 UTC cb58dfd6453171a88183fc7bf1587bae6929c0e4
2 files changed -22
packages/shared/src/relayAuth.test.ts
-11
@@ -5,7 +5,6 @@ import {
5 ClerkPublishableKeyFrontendApiError,
6 clerkFrontendApiHostnameFromPublishableKey,
7 clerkFrontendApiUrlFromPublishableKey,
8 - isAllowedClerkFrontendApiHostname,
8 } from "./relayAuth.ts";
9
10 const clerkPublishableKey = (hostname: string): string => `pk_test_${btoa(`${hostname}$`)}`;
@@ -75,14 +74,4 @@ describe("Clerk relay auth", () => {
74 });
75 expect((error as ClerkPublishableKeyFrontendApiError).cause).toBeInstanceOf(Error);
76 });
78 -
79 - it("allows standard Clerk hosts and an exact configured custom hostname", () => {
80 - expect(isAllowedClerkFrontendApiHostname("example.clerk.accounts.dev", null)).toBe(true);
81 - expect(isAllowedClerkFrontendApiHostname("example.clerk.accounts.com", null)).toBe(true);
82 - expect(isAllowedClerkFrontendApiHostname("clerk.t3.codes", "clerk.t3.codes")).toBe(true);
83 - expect(isAllowedClerkFrontendApiHostname("attacker.example", "clerk.t3.codes")).toBe(false);
84 - expect(isAllowedClerkFrontendApiHostname("nested.clerk.t3.codes", "clerk.t3.codes")).toBe(
85 - false,
86 - );
87 - });
77 });
packages/shared/src/relayAuth.ts
-11
@@ -81,17 +81,6 @@ export function clerkFrontendApiHostnameFromPublishableKey(publishableKey: strin
81 return parseClerkFrontendApi(publishableKey).hostname;
82 }
83
84 -export function isAllowedClerkFrontendApiHostname(
85 - hostname: string,
86 - configuredHostname: string | null,
87 -): boolean {
88 - return (
89 - hostname.endsWith(".clerk.accounts.dev") ||
90 - hostname.endsWith(".clerk.accounts.com") ||
91 - hostname === configuredHostname
92 - );
93 -}
94 -
84 export function relayClerkTokenOptions(template: string) {
85 return {
86 template,