Files
buzz/app/api/auth/[...all]/handler.ts

9 lines
233 B
TypeScript

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