fix adminwrap issue

This commit is contained in:
2026-03-10 19:52:00 +01:00
parent 7a8736d9c5
commit fc4fab9478
7 changed files with 24 additions and 15 deletions

View File

@@ -4,6 +4,7 @@ import { env } from "~/env";
const isTenantAdminRoute = createRouteMatcher(['/admin(.*)'])
export default clerkMiddleware(async (auth,req) => {
if (isTenantAdminRoute(req)) {
console.log("running clerk middleware");
let userid = (await auth()).userId
if (userid != env.ADMIN_USER_CLERK_ID) {
await auth.protect()