fix(proxy): fix auth middleware ordering for Hono

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Vadim Sobinin
2026-03-15 00:27:35 +03:00
parent 6bd6a6c8c8
commit eccc71d4ff
2 changed files with 10 additions and 4 deletions

View File

@@ -7,6 +7,12 @@ export const authMiddleware: MiddlewareHandler = async (c, next) => {
return next();
}
// Skip auth for auth routes themselves
const path = new URL(c.req.url).pathname;
if (path.startsWith('/api/auth')) {
return next();
}
const header = c.req.header('Authorization');
const token = header?.startsWith('Bearer ') ? header.slice(7) : null;