diff --git a/src/common/middleware/middleware.service.ts b/src/common/middleware/middleware.service.ts index b1fd49b..34167b9 100644 --- a/src/common/middleware/middleware.service.ts +++ b/src/common/middleware/middleware.service.ts @@ -356,7 +356,7 @@ export class MiddlewareServices { req.userId, req.headers['tenantid'], ); - if (rolesOfTenant.name == 'UnauthorizedException') { + if (!rolesOfTenant && rolesOfTenant.response.error == 'Unauthorized') { return reject("User doesn't have appropriate privilege"); }