Skip to content

Commit cd7d9a5

Browse files
committed
remove expectAuth flag from Convex client initialization
1 parent 2353a14 commit cd7d9a5

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

app/layout.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { Metadata } from 'next';
22
import { Geist, Geist_Mono } from 'next/font/google';
33
import './globals.css';
44
import { ConvexClientProvider } from '@/components/ConvexClientProvider';
5-
import { withAuth } from '@workos-inc/authkit-nextjs';
65

76
const geistSans = Geist({
87
variable: '--font-geist-sans',
@@ -22,16 +21,15 @@ export const metadata: Metadata = {
2221
},
2322
};
2423

25-
export default async function RootLayout({
24+
export default function RootLayout({
2625
children,
2726
}: Readonly<{
2827
children: React.ReactNode;
2928
}>) {
30-
const expectAuth = !!(await withAuth()).user
3129
return (
3230
<html lang="en">
3331
<body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>
34-
<ConvexClientProvider expectAuth={expectAuth}>{children}</ConvexClientProvider>
32+
<ConvexClientProvider>{children}</ConvexClientProvider>
3533
</body>
3634
</html>
3735
);

components/ConvexClientProvider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { ConvexReactClient } from 'convex/react';
55
import { ConvexProviderWithAuth } from 'convex/react';
66
import { AuthKitProvider, useAuth, useAccessToken } from '@workos-inc/authkit-nextjs/components';
77

8-
export function ConvexClientProvider({ children, expectAuth }: { children: ReactNode; expectAuth: boolean }) {
8+
export function ConvexClientProvider({ children }: { children: ReactNode }) {
99
const [convex] = useState(() => {
10-
return new ConvexReactClient(process.env.NEXT_PUBLIC_CONVEX_URL!, { expectAuth });
10+
return new ConvexReactClient(process.env.NEXT_PUBLIC_CONVEX_URL!);
1111
});
1212
return (
1313
<AuthKitProvider>

0 commit comments

Comments
 (0)