From 7ab813fb64c8d637f35333aec42ce09b2391fe06 Mon Sep 17 00:00:00 2001 From: Andrea Lovicu Date: Thu, 14 Nov 2024 12:26:31 +0100 Subject: [PATCH] fix: add debug logs on securityValidator --- src/operation.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/operation.ts b/src/operation.ts index e4a2e6e..ccfc798 100644 --- a/src/operation.ts +++ b/src/operation.ts @@ -158,6 +158,7 @@ export abstract class Operation { this.checkAbility(req.ability); } catch (err) { req.logger.warn(`insufficient ability`, err); + req.logger.debug('insufficient privileges for user perms', req['perms']); next(API.newError(403, 'insufficient privileges')); } req.logger.debug('ability ok'); @@ -165,6 +166,7 @@ export abstract class Operation { } else if (req.scopes) { if (!req.scopes.match(this.scopes)) { req.logger.warn('insufficient scope', req.scopes); + req.logger.debug('insufficient privileges for user scopes', req.scopes); next(API.newError(403, 'insufficient privileges')); } else { req.logger.debug('scope ok');