Skip to content

Commit

Permalink
Update authorize-handler.js
Browse files Browse the repository at this point in the history
  • Loading branch information
YousefED committed Jul 29, 2019
1 parent 90d0049 commit 0cce90b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/handlers/authorize-handler.js
Expand Up @@ -78,10 +78,6 @@ AuthorizeHandler.prototype.handle = function(request, response) {
throw new InvalidArgumentError('Invalid argument: `response` must be an instance of Response');
}

if ('false' === request.query.allowed) {
return Promise.reject(new AccessDeniedError('Access denied: user denied access to application'));
}

var fns = [
this.getAuthorizationCodeLifetime(),
this.getClient(request),
Expand All @@ -97,6 +93,16 @@ AuthorizeHandler.prototype.handle = function(request, response) {
var ResponseType;

return Promise.bind(this)
.then(function() {
state = this.getState(request);
})
.then(function() {
if ("false" === request.query.allowed) {
throw new AccessDeniedError(
"Access denied: user denied access to application"
);
}
})
.then(function() {
scope = this.getScope(request);

Expand Down

0 comments on commit 0cce90b

Please sign in to comment.