Files
archived-next-auth/apps/dev/nextjs/pages/api/examples/session.ts
Balázs Orbán 58be169b10 update dev app
2023-04-07 12:51:41 +02:00

9 lines
320 B
TypeScript

import { authConfig } from "app/api/auth/[...nextauth]/route"
// This is an example of how to access a session from an API route
import { unstable_getServerSession } from "next-auth/next"
export default async (req, res) => {
const session = await unstable_getServerSession(req, res, authConfig)
res.json(session)
}