refactor(frontend): share Clerk publishable-key heuristic across client+server

This commit is contained in:
Ishan (OpenClaw)
2026-02-07 10:09:21 +00:00
parent 795f40e50b
commit fd954238ea
4 changed files with 32 additions and 19 deletions

View File

@@ -3,12 +3,12 @@
import { ClerkProvider } from "@clerk/nextjs";
import type { ReactNode } from "react";
import { isValidClerkPublishableKey } from "@/auth/clerk";
import { isLikelyValidClerkPublishableKey } from "@/auth/clerkKey";
export function AuthProvider({ children }: { children: ReactNode }) {
const publishableKey = process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY;
if (!isValidClerkPublishableKey(publishableKey)) {
if (!isLikelyValidClerkPublishableKey(publishableKey)) {
return <>{children}</>;
}