Browse files

issue #20: returned results to the callback along with access_token a…

…nd refresh_token

Other implementations return more than just access_token and the
refresh_token.  For example, salesforce returns the instance url.
  • Loading branch information...
1 parent 99e6259 commit dc0b92cd56acd73ff467ef527b1e2b39429e0f7b @gidzone committed Sep 1, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/oauth2.js
@@ -136,7 +136,9 @@ exports.OAuth2.prototype.getOAuthAccessToken= function(code, params, callback) {
var access_token= results["access_token"];
var refresh_token= results["refresh_token"];
delete results["refresh_token"];
- callback(null, access_token, refresh_token);
+ //passing results to the callback as other implementations return additional information
+ callback(null, access_token, refresh_token, results);

2 comments on commit dc0b92c

looks good, I guess there should be a delete results["access_token"] in there as well now we're actually passing that literal back to the consumer (tbh I'm not sure why the delete results["refresh_token"] is in there, but its always good to be consistent!

If you wouldn't mind adjusting that i'll gratefully/happily pull in both your submitted commits ? :)



gidzone replied Sep 4, 2011

Please sign in to comment.