type AuthHandler = (request: Request) => Response | Promise; export function createAuthHandlers( toHandler: (auth: TAuth) => { GET: AuthHandler; POST: AuthHandler }, auth: TAuth, ) { return toHandler(auth); }