feat: add clerk auth support with convex (#548)

This commit is contained in:
Aman Varshney
2025-08-29 00:21:08 +05:30
committed by GitHub
parent 8d48ae0359
commit 54bcdf1cbc
153 changed files with 1954 additions and 771 deletions

View File

@@ -1,7 +1,8 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "../index.css";
import Providers from "@/components/providers";
{{#if (eq auth "clerk")}}{{#if (eq backend "convex")}}import { ClerkProvider } from "@clerk/nextjs";
{{/if}}{{/if}}import Providers from "@/components/providers";
import Header from "@/components/header";
const geistSans = Geist({
@@ -24,18 +25,25 @@ export default function RootLayout({
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en" suppressHydrationWarning>
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
<Providers>
<div className="grid grid-rows-[auto_1fr] h-svh">
<Header />
{children}
</div>
</Providers>
</body>
</html>
);
return (
<html lang="en" suppressHydrationWarning>
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{{#if (and (eq auth "clerk") (eq backend "convex"))}}<ClerkProvider>
<Providers>
<div className="grid grid-rows-[auto_1fr] h-svh">
<Header />
{children}
</div>
</Providers>
</ClerkProvider>{{else}}<Providers>
<div className="grid grid-rows-[auto_1fr] h-svh">
<Header />
{children}
</div>
</Providers>{{/if}}
</body>
</html>
);
}