Make API in app router using NextAuth.js
Answered
Pond loach posted this in #help-forum
Pond loachOP
Hello, how can i make API in app router with authentification from nextauth with NextRequest and NextResponse?
5 Replies
Pond loachOP
I'am on nextauth version 4.24.7.
@Pond loach Hello, how can i make API in app router with authentification from nextauth with NextRequest and NextResponse?
const session = await getServerSession(authOptions)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