refactor(frontend): share Clerk publishable-key heuristic across client+server
This commit is contained in:
@@ -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}</>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user