passport-oauth2
passport-oauth2 copied to clipboard
Checking for missing accessToken in getOAuthAccessToken breaks some oauth client integrations
With the introduction of a check for missing a accessToken
in the getOAuthAccessToken
function, some oauth clients break.
For instance, withings doesn't return an accessToken
in the accessToken
parameter, but returns it in the params
parameter.
Here is a sample response from withings.
{
err: null,
accessToken: undefined,
refreshToken: undefined,
params: {
status: 0,
body: {
userid: 'REDACTED',
access_token: 'REDACTED',
refresh_token: 'REDACTED',
scope: 'REDACTED',
expires_in: 10800,
token_type: 'Bearer'
}
}
}
old
self._loadUserProfile(accessToken, function(err, profile) {...}
new
self._loadUserProfile(params, function(err, profile) {...}