import { NextApiResponse , NextApiRequest } from 'next' ; import { HandleLogout as BaseHandleLogout } from '../auth0-session' ; import { assertReqRes } from '../utils/assert' ; import { HandlerError } from '../utils/errors' ; category export interface LogoutOptions { /**
     *  URL to returnTo after logout, overrides the
     *  Default in  BaseConfig . routes . postLogoutRedirect returnTo ? : string ; } throws category export type HandleLogout = ( req : NextApiRequest , res : NextApiResponse , options ? : LogoutOptions ) => Promise < void > ; ignore export default function handleLogoutFactory ( handler ) { return async ( req , res , options ) : Promise < void > => { try { assertReqRes ( req , res ) ; return await handler ( req , res , options ) ; } catch ( e ) { throw new HandlerError ( e ) ; } } ; }