mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-22 00:31:17 +00:00
7 lines
214 B
TypeScript
7 lines
214 B
TypeScript
export function withAuth(handler: Function) {
|
|
return async (req: Request) => {
|
|
const token = req.headers.get('Authorization');
|
|
if (!token) throw new Error('Unauthorized');
|
|
return handler(req);
|
|
};
|
|
}
|