Next.js Discord

Discord Forum

Make API in app router using NextAuth.js

Answered
Pond loach posted this in #help-forum
Open in Discord
Pond loachOP
Hello, how can i make API in app router with authentification from nextauth with NextRequest and NextResponse?
Answered by joulev
const session = await getServerSession(authOptions)
View full answer

5 Replies

Pond loachOP
I'am on nextauth version 4.24.7.
Answer
Pond loachOP
But i can not use this with NextRequest and NextResponse in .ts file? or can i?
try it
Pond loachOP
Okay, i can, sorry