Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include check that access token was actually successfully returned #144

Merged
merged 2 commits into from
Sep 24, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Include a check to ensure accessToken is returned
  • Loading branch information
Ben committed Sep 23, 2021
commit ec7298324799f879a40b9a2a58bcb4be704c37de
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