Skip to content

Commit

Permalink
Merge pull request #144 from ben12385/master
Browse files Browse the repository at this point in the history
Include check that access token was actually successfully returned
  • Loading branch information
jaredhanson committed Sep 24, 2021
2 parents 86a6ae4 + ec72983 commit 4f8f86c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/strategy.js
Expand Up @@ -174,7 +174,7 @@ OAuth2Strategy.prototype.authenticate = function(req, options) {

self._oauth2.getOAuthAccessToken(code, params,
function(err, accessToken, refreshToken, params) {
if (err) { return self.error(self._createOAuthError('Failed to obtain access token', err)); }
if (err || !accessToken) { return self.error(self._createOAuthError('Failed to obtain access token', err)); }

self._loadUserProfile(accessToken, function(err, profile) {
if (err) { return self.error(err); }
Expand Down

0 comments on commit 4f8f86c

Please sign in to comment.