import type { NextApiRequest , NextApiResponse } from "next" ; import initAuth from "@/lib/auth" ; async function login ( req , res ) { try { await initAuth . handleLogin ( req , res ) ; } catch ( error ) { console . error ( error ) ; res . status ( error . status ?? 500 ) . end ( error . message ) ; } } export default login ;