@@ -20,8 +20,7 @@ function githubUrl (path) {
2020}
2121
2222passport . use ( new GithubStrategy ( {
23- scope : ( config . github . organizations ?
24- config . github . scopes . concat ( [ 'read:org' ] ) : config . github . scope ) ,
23+ scope : ( config . github . organizations ? config . github . scopes . concat ( [ 'read:org' ] ) : config . github . scope ) ,
2524 clientID : config . github . clientID ,
2625 clientSecret : config . github . clientSecret ,
2726 callbackURL : config . serverURL + '/auth/github/callback' ,
@@ -34,18 +33,20 @@ passport.use(new GithubStrategy({
3433 }
3534 const { statusCode, body : data } = await rp ( {
3635 url : `https://api.github.com/user/orgs` ,
37- method : 'GET' , json : true , timeout : 2000 ,
36+ method : 'GET' ,
37+ json : true ,
38+ timeout : 2000 ,
3839 headers : {
39- ' Authorization' : `token ${ accessToken } ` ,
40+ Authorization : `token ${ accessToken } ` ,
4041 'User-Agent' : 'nodejs-http'
4142 }
4243 } )
43- if ( statusCode != 200 ) {
44+ if ( statusCode !== 200 ) {
4445 return done ( InternalOAuthError (
4546 `Failed to query organizations for user: ${ profile . username } `
4647 ) )
4748 }
48- const orgs = data . map ( ( { login} ) => login )
49+ const orgs = data . map ( ( { login } ) => login )
4950 for ( const org of orgs ) {
5051 if ( config . github . organizations . includes ( org ) ) {
5152 return passportGeneralCallback ( accessToken , refreshToken , profile , done )
0 commit comments