Skip to content

Commit f1367ba

Browse files
authored
Merge pull request #1058 from ccoenen/bug/oauth2internalerror
InternalOAuthError is not part of passport, but of passport-oauth2 #1056
2 parents db69983 + 56c0434 commit f1367ba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/web/auth/oauth2/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
const Router = require('express').Router
44
const passport = require('passport')
5-
const OAuth2Strategy = require('passport-oauth2').Strategy
5+
const { Strategy, InternalOAuthError } = require('passport-oauth2')
66
const config = require('../../../config')
77
const {setReturnToFromReferer, passportGeneralCallback} = require('../utils')
88

99
let oauth2Auth = module.exports = Router()
1010

11-
class OAuth2CustomStrategy extends OAuth2Strategy {
11+
class OAuth2CustomStrategy extends Strategy {
1212
constructor (options, verify) {
1313
options.customHeaders = options.customHeaders || {}
1414
super(options, verify)
@@ -22,7 +22,7 @@ class OAuth2CustomStrategy extends OAuth2Strategy {
2222
var json
2323

2424
if (err) {
25-
return done(new passport.InternalOAuthError('Failed to fetch user profile', err))
25+
return done(new InternalOAuthError('Failed to fetch user profile', err))
2626
}
2727

2828
try {
@@ -67,7 +67,7 @@ OAuth2CustomStrategy.prototype.userProfile = function (accessToken, done) {
6767
var json
6868

6969
if (err) {
70-
return done(new passport.InternalOAuthError('Failed to fetch user profile', err))
70+
return done(new InternalOAuthError('Failed to fetch user profile', err))
7171
}
7272

7373
try {

0 commit comments

Comments
 (0)