Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

authorizeUrlMethod() checks err returned from fetchAuthorizationInfor…

…mation()

We weren't checking the err response before. This patch adds a quick check and a call to the authorize_provider if there's an error.
  • Loading branch information...
commit 5a7371206d8d5df7a59adab88b59000ae75574a3 1 parent e1c75d2
@evanp authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/auth.strategies/oauth/oauth.js
View
9 lib/auth.strategies/oauth/oauth.js
@@ -128,8 +128,13 @@ module.exports= function(options) {
} else {
// Fetch the needed data
my['oauth_service'].fetchAuthorizationInformation(req.body['username'], result.token, function(err, application, user) {
- // Signal callback about finish authorization
- my.authorize_provider.call(self, null, req, res, true, result, application, user);
+ if(err) {
+ // Delegate to the function of the user
+ my.authorize_provider.call(self, err, req, res, false, {token:req.body['oauth_token']});
+ } else {
+ // Signal callback about finish authorization
+ my.authorize_provider.call(self, null, req, res, true, result, application, user);
+ }
});
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.