harden admin api authorization and add authz regression tests

This commit is contained in:
dimitar committed 2026-03-29 11:23:49 +02:00
1 parent 272c9b36dd
commit 10b58245f5
28 files changed
+1336 -240

No files matched your search

-8
View File
@@ -25,14 +25,6 @@ const isPublicRoute = createRouteMatcher([
const isApiRoute = createRouteMatcher(["/api/(.*)"]);
export default clerkMiddleware(async (auth, req) => {
// Log for debugging
const authHeader = req.headers.get("authorization");
if (authHeader) {
log.debug("Authorization header present", {
preview: authHeader.substring(0, 20) + "...",
});
}
// Don't protect public routes
if (isPublicRoute(req)) {
log.debug("Public route, skipping auth");