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:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: app.dockerfile
|
dockerfile: app.dockerfile
|
||||||
|
env_file:
|
||||||
|
- .env # env variables for auth0
|
||||||
environment:
|
environment:
|
||||||
- SEARXNG_API_URL=http://searxng:8080
|
- SEARXNG_API_URL=http://searxng:8080
|
||||||
ports:
|
ports:
|
||||||
|
|
|
||||||
5
notes.md
5
notes.md
|
|
@ -1,2 +1,5 @@
|
||||||
### Adding auth0
|
### 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"
|
"db:push": "drizzle-kit push"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@auth0/nextjs-auth0": "^4.2.1",
|
"@auth0/nextjs-auth0": "^2",
|
||||||
"@headlessui/react": "^2.2.0",
|
"@headlessui/react": "^2.2.0",
|
||||||
"@iarna/toml": "^2.2.5",
|
"@iarna/toml": "^2.2.5",
|
||||||
"@icons-pack/react-simple-icons": "^12.3.0",
|
"@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 Sidebar from '@/components/Sidebar';
|
||||||
import { Toaster } from 'sonner';
|
import { Toaster } from 'sonner';
|
||||||
import ThemeProvider from '@/components/theme/Provider';
|
import ThemeProvider from '@/components/theme/Provider';
|
||||||
|
import { UserProvider } from '@auth0/nextjs-auth0/client'; // ✅ Auth0 wrapper
|
||||||
|
|
||||||
const montserrat = Montserrat({
|
const montserrat = Montserrat({
|
||||||
weight: ['300', '400', '500', '700'],
|
weight: ['300', '400', '500', '700'],
|
||||||
|
|
@ -27,6 +28,7 @@ export default function RootLayout({
|
||||||
return (
|
return (
|
||||||
<html className="h-full" lang="en" suppressHydrationWarning>
|
<html className="h-full" lang="en" suppressHydrationWarning>
|
||||||
<body className={cn('h-full', montserrat.className)}>
|
<body className={cn('h-full', montserrat.className)}>
|
||||||
|
<UserProvider> {/* ✅ Wrap app in Auth0 context */}
|
||||||
<ThemeProvider>
|
<ThemeProvider>
|
||||||
<Sidebar>{children}</Sidebar>
|
<Sidebar>{children}</Sidebar>
|
||||||
<Toaster
|
<Toaster
|
||||||
|
|
@ -39,6 +41,7 @@ export default function RootLayout({
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
|
</UserProvider>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue