harden admin api authorization and add authz regression tests
This commit is contained in:
1 parent
272c9b36dd
commit
10b58245f5
28 files changed
+1336
-240
No files matched your search
@@ -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");
|
||||
|
||||
Reference in new issue
Block a user