auth0 v2 uses pages router not app router. building correctly now
This commit is contained in:
parent
39c8eef888
commit
e7ff02f1b8
6 changed files with 1519 additions and 1182 deletions
|
|
@ -14,6 +14,8 @@ services:
|
|||
build:
|
||||
context: .
|
||||
dockerfile: app.dockerfile
|
||||
env_file:
|
||||
- .env # env variables for auth0
|
||||
environment:
|
||||
- SEARXNG_API_URL=http://searxng:8080
|
||||
ports:
|
||||
|
|
|
|||
5
notes.md
5
notes.md
|
|
@ -1,2 +1,5 @@
|
|||
### Adding auth0
|
||||
use `yard add` for new packages and the packages will be updated automatically
|
||||
* use `yard add` for new packages and the packages will be updated automatically
|
||||
* auth-secret generate with `openssl rand -hex 32`
|
||||
* need to no-cache if updating packages...don't need to remove `--frozen-lockfile` can be handled with `yarn`
|
||||
* version 2 is using
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
"db:push": "drizzle-kit push"
|
||||
},
|
||||
"dependencies": {
|
||||
"@auth0/nextjs-auth0": "^4.2.1",
|
||||
"@auth0/nextjs-auth0": "^2",
|
||||
"@headlessui/react": "^2.2.0",
|
||||
"@iarna/toml": "^2.2.5",
|
||||
"@icons-pack/react-simple-icons": "^12.3.0",
|
||||
|
|
|
|||
4
src/app/api/auth/[...auth].ts
Normal file
4
src/app/api/auth/[...auth].ts
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
// pages/api/auth/[...auth0].ts
|
||||
import { handleAuth } from '@auth0/nextjs-auth0';
|
||||
|
||||
export default handleAuth();
|
||||
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue