Skip to content

Commit

Permalink
fix: add debug logs on securityValidator
Browse files Browse the repository at this point in the history
  • Loading branch information
alovicu committed Nov 14, 2024
1 parent 9c6fbac commit 7ab813f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,15 @@ 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');
next();
} 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');
Expand Down

0 comments on commit 7ab813f

Please sign in to comment.