Skip to content

Commit

Permalink
Merge 674cb07 into 7003c47
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerges Beshay committed Oct 18, 2016
2 parents 7003c47 + 674cb07 commit 318cdec
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/all-grants/oauth2.js
Expand Up @@ -179,6 +179,18 @@ exports.authorization = [
// been warned.
return done(null, client, redirectURI);
});
}, function (client, user, done) {
// Check if grant request qualifies for immediate approval
if (user.has_token(client)) {
// Auto-approve
return done(null, true);
}
if (client.isTrusted()) {
// Auto-approve
return done(null, true);
}
// Otherwise ask user
done(null, false);
}),
function(req, res){
res.render('dialog', { transactionID: req.oauth2.transactionID, user: req.user, client: req.oauth2.client });
Expand Down

0 comments on commit 318cdec

Please sign in to comment.