diff --git a/apps/api/src/middlewares/auth/utils/utils.ts b/apps/api/src/middlewares/auth/utils/utils.ts index 7beb4b2e8..665d1f956 100644 --- a/apps/api/src/middlewares/auth/utils/utils.ts +++ b/apps/api/src/middlewares/auth/utils/utils.ts @@ -15,7 +15,10 @@ export function isRouteDisabled(options: Pick) { const url = options.req.originalUrl.toLowerCase(); const requestMethod = options.req.method as Method; - const route = DISABLED_API_TOKEN_ROUTES.find(([r]) => url.endsWith(r)); + const route = DISABLED_API_TOKEN_ROUTES.find(([pathname]) => { + const urlPathname = new URL(url, "https://example.com").pathname.toLowerCase(); + return urlPathname.endsWith(pathname.toLowerCase()); + }); if (route) { const [, methods] = route;