9 lines
233 B
TypeScript
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);
|
|
}
|