Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
@@ -5,7 +5,7 @@ import { db } from "./db.server";
|
||||
import { getUserRoleInTenant } from "./db/permissions/userRoles.db.server";
|
||||
import { Params } from "react-router";
|
||||
import { DefaultAppRoles } from "~/application/dtos/shared/DefaultAppRoles";
|
||||
import { loadRequiredWebConfig } from "@toolctrl/config";
|
||||
import { loadRequiredWebConfig } from "@hivegrid/config";
|
||||
import { getHostRoutingContextFromRequest } from "./app/HostRouting.server";
|
||||
|
||||
const webConfig = loadRequiredWebConfig();
|
||||
@@ -34,8 +34,11 @@ export async function requireAuth({ request, params, adminOnly }: { request: Req
|
||||
}
|
||||
const member = await getTenantUserType(userInfo.userId, tenantId);
|
||||
if (!member) {
|
||||
const isSuperAdmin = await getIsSuperAdminByUserId(userInfo.userId);
|
||||
if (!isSuperAdmin) {
|
||||
const [isSuperAdmin, user] = await Promise.all([
|
||||
getIsSuperAdminByUserId(userInfo.userId),
|
||||
db.user.findUnique({ where: { id: userInfo.userId }, select: { admin: true } }),
|
||||
]);
|
||||
if (!isSuperAdmin && !user?.admin) {
|
||||
throw Response.json(UNAUTHORIZED_ENVELOPE, { status: 401 });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user