feat: wire up clerk
+ Add convex provider with clerk + Add clerk provider + Add account page + Add login page + Add sign up page + Add clerk middleware + Add Navbar component
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
'use client';
|
||||
|
||||
import { useAuth } from '@clerk/nextjs';
|
||||
import { ConvexReactClient } from 'convex/react';
|
||||
import { ConvexProviderWithClerk } from 'convex/react-clerk';
|
||||
import { ReactNode } from 'react';
|
||||
|
||||
const CONVEX_URL = process.env.NEXT_PUBLIC_CONVEX_URL;
|
||||
|
||||
if (CONVEX_URL === undefined) {
|
||||
throw Error('NEXT_PUBLIC_CONVEX_URL is undefined');
|
||||
}
|
||||
|
||||
const client = new ConvexReactClient(CONVEX_URL);
|
||||
|
||||
export default function ConvexProvider({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<ConvexProviderWithClerk
|
||||
client={client}
|
||||
useAuth={useAuth}
|
||||
>
|
||||
{children}
|
||||
</ConvexProviderWithClerk>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user