import { getToken } from "next-auth/jwt" ; import type { NextApiRequest , NextApiResponse } from "next" ; const secret = process . env . SECRET ; export default async function jwt ( req , res ) { const token = await getToken ( { req , secret } ) ; res . send ( JSON . stringify ( token , null , 2 ) ) ; }