Skip to content

Commit 5b5de24

Browse files
committed
fix(authorization): use simplified if-branch to check for body allow value
1 parent 5e8962d commit 5b5de24

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/handlers/authorize-handler.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,7 @@ AuthorizeHandler.prototype.handle = function(request, response) {
7777
throw new InvalidArgumentError('Invalid argument: `response` must be an instance of Response');
7878
}
7979

80-
const notAllowed = [
81-
request.query.allowed,
82-
request.body.allowed
83-
].some(allowed => 'false' === allowed);
84-
85-
if (notAllowed) {
80+
if (request.query.allowed === 'false' || request.body.allowed === 'false') {
8681
return Promise.reject(new AccessDeniedError('Access denied: user denied access to application'));
8782
}
8883

0 commit comments

Comments
 (0)