Skip to content

Commit

Permalink
Merge pull request #14 from w304807481/getUser_bug
Browse files Browse the repository at this point in the history
修复access_token失效时后,无法通过getUser获取用户信息的问题
  • Loading branch information
JacksonTian committed Jan 27, 2016
2 parents d38b3ac + 4f34bbd commit 8fe8595
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ OAuth.prototype.getUser = function (options, callback) {
if (err) {
return callback(err);
}
that._getUser(options, token.access_token, callback);
that._getUser(options, token.data.access_token, callback);
});
}
});
Expand Down
12 changes: 7 additions & 5 deletions test/oauth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,13 @@ describe('oauth.js', function () {

muk(api, 'refreshAccessToken', function (refreshToken, callback) {
var resp = {
"access_token":"ACCESS_TOKEN",
"expires_in":7200,
"refresh_token":"REFRESH_TOKEN",
"openid":"OPENID",
"scope":"SCOPE"
data: {
"access_token": "ACCESS_TOKEN",
"expires_in": 7200,
"refresh_token": "REFRESH_TOKEN",
"openid": "OPENID",
"scope": "SCOPE"
}
};
process.nextTick(function () {
callback(null, resp);
Expand Down

0 comments on commit 8fe8595

Please sign in to comment.