passport-oauth2 icon indicating copy to clipboard operation
passport-oauth2 copied to clipboard

Checking for missing cropId in getOAuthAccessToken

Open MaleWeb opened this issue 3 years ago • 0 comments

For instance, withings doesn't return an cropId in the getOAuthAccessToken,Here is a sample response from Dingtalk. this._oauth2.getOAuthAccessToken = function(code, params, callback) { var self = this; urllib.request( this._persistentTokenURL, { headers: { "Content-Type": "application/json" }, method: "POST", dataType: "json", data: { clientId: self._clientId, clientSecret: self._clientSecret, code: code, grantType: "authorization_code" } }, function(err, data, res) { if (err) return callback(err); var accessToken = data.accessToken; var refreshToken = data.refreshToken; // data.cropId??无法传递 if (!accessToken || !refreshToken) return callback(new Error("refreshToken failed")); callback(null, accessToken, refreshToken,data); } ); };

MaleWeb avatar Dec 17 '21 10:12 MaleWeb