Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions lib/handlers/authorize-handler.js
Original file line number Diff line number Diff line change
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