feat: add sign-out redirect URL and enhance sign-in redirect handling

This commit is contained in:
Abhimanyu Saharan
2026-02-09 01:06:33 +05:30
parent f6bcd1ca5f
commit 5630f9b8e8
6 changed files with 123 additions and 6 deletions

View File

@@ -7,12 +7,19 @@ import { isLikelyValidClerkPublishableKey } from "@/auth/clerkKey";
export function AuthProvider({ children }: { children: ReactNode }) {
const publishableKey = process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY;
const afterSignOutUrl =
process.env.NEXT_PUBLIC_CLERK_AFTER_SIGN_OUT_URL ?? "/";
if (!isLikelyValidClerkPublishableKey(publishableKey)) {
return <>{children}</>;
}
return (
<ClerkProvider publishableKey={publishableKey}>{children}</ClerkProvider>
<ClerkProvider
publishableKey={publishableKey}
afterSignOutUrl={afterSignOutUrl}
>
{children}
</ClerkProvider>
);
}