File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 2
2
3
3
const Router = require ( 'express' ) . Router
4
4
const passport = require ( 'passport' )
5
- const OAuth2Strategy = require ( 'passport-oauth2' ) . Strategy
5
+ const { Strategy , InternalOAuthError } = require ( 'passport-oauth2' )
6
6
const config = require ( '../../../config' )
7
7
const { setReturnToFromReferer, passportGeneralCallback} = require ( '../utils' )
8
8
9
9
let oauth2Auth = module . exports = Router ( )
10
10
11
- class OAuth2CustomStrategy extends OAuth2Strategy {
11
+ class OAuth2CustomStrategy extends Strategy {
12
12
constructor ( options , verify ) {
13
13
options . customHeaders = options . customHeaders || { }
14
14
super ( options , verify )
@@ -22,7 +22,7 @@ class OAuth2CustomStrategy extends OAuth2Strategy {
22
22
var json
23
23
24
24
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 ) )
26
26
}
27
27
28
28
try {
@@ -67,7 +67,7 @@ OAuth2CustomStrategy.prototype.userProfile = function (accessToken, done) {
67
67
var json
68
68
69
69
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 ) )
71
71
}
72
72
73
73
try {
You can’t perform that action at this time.
0 commit comments