Browse Source

fix: handle if invalid token

pull/7444/head
Pranav C 11 months ago
parent
commit
67a13da1af
  1. 4
      packages/nocodb/src/middlewares/extract-ids/extract-ids.middleware.ts

4
packages/nocodb/src/middlewares/extract-ids/extract-ids.middleware.ts

@ -216,6 +216,10 @@ export class AclMiddleware implements NestInterceptor {
const req = context.switchToHttp().getRequest(); const req = context.switchToHttp().getRequest();
if (!req.user?.isAuthorized) {
NcError.unauthorized('Invalid token');
}
const userScopeRole = const userScopeRole =
req.user.roles?.[OrgUserRoles.SUPER_ADMIN] === true req.user.roles?.[OrgUserRoles.SUPER_ADMIN] === true
? OrgUserRoles.SUPER_ADMIN ? OrgUserRoles.SUPER_ADMIN

Loading…
Cancel
Save