import { getSession } from "next-auth/react" ; import type { NextApiRequest , NextApiResponse } from "next" ; export default async function session ( req , res ) { const session = await getSession ( { req } ) ; res . send ( JSON . stringify ( session , null , 2 ) ) ; }