Skip to content

Commit

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

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

0 comments on commit 83a9409

Please sign in to comment.