auth0 v2 uses pages router not app router. building correctly now

This commit is contained in:
Genuinely 2025-03-24 15:40:14 -07:00
parent 39c8eef888
commit e7ff02f1b8
6 changed files with 1519 additions and 1182 deletions

View file

@ -0,0 +1,4 @@
// pages/api/auth/[...auth0].ts
import { handleAuth } from '@auth0/nextjs-auth0';
export default handleAuth();

View file

@ -5,6 +5,7 @@ import { cn } from '@/lib/utils';
import Sidebar from '@/components/Sidebar';
import { Toaster } from 'sonner';
import ThemeProvider from '@/components/theme/Provider';
import { UserProvider } from '@auth0/nextjs-auth0/client'; // ✅ Auth0 wrapper
const montserrat = Montserrat({
weight: ['300', '400', '500', '700'],
@ -27,19 +28,21 @@ export default function RootLayout({
return (
<html className="h-full" lang="en" suppressHydrationWarning>
<body className={cn('h-full', montserrat.className)}>
<ThemeProvider>
<Sidebar>{children}</Sidebar>
<Toaster
toastOptions={{
unstyled: true,
classNames: {
toast:
'bg-light-primary dark:bg-dark-secondary dark:text-white/70 text-black-70 rounded-lg p-4 flex flex-row items-center space-x-2',
},
}}
/>
</ThemeProvider>
<UserProvider> {/* ✅ Wrap app in Auth0 context */}
<ThemeProvider>
<Sidebar>{children}</Sidebar>
<Toaster
toastOptions={{
unstyled: true,
classNames: {
toast:
'bg-light-primary dark:bg-dark-secondary dark:text-white/70 text-black-70 rounded-lg p-4 flex flex-row items-center space-x-2',
},
}}
/>
</ThemeProvider>
</UserProvider>
</body>
</html>
);
}
}