Skip to content

Commit

Permalink
Include a check to ensure accessToken is returned
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben committed Sep 23, 2021
1 parent 83a9409 commit ec72983
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +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 (!accessToken){ return 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 ec72983

Please sign in to comment.