Skip to content

Commit 5ce1537

Browse files
committed
fix: js standard code styles
Signed-off-by: Max Wu <[email protected]>
1 parent dd4c236 commit 5ce1537

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

lib/auth/github/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ function githubUrl (path) {
2020
}
2121

2222
passport.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)

lib/config/environment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ module.exports = {
7171
clientID: process.env.CMD_GITHUB_CLIENTID,
7272
clientSecret: process.env.CMD_GITHUB_CLIENTSECRET,
7373
organizations: toArrayConfig(process.env.CMD_GITHUB_ORGANIZATIONS),
74-
scopes: toArrayConfig(process.env.CMD_GITHUB_SCOPES),
74+
scopes: toArrayConfig(process.env.CMD_GITHUB_SCOPES)
7575
},
7676
bitbucket: {
7777
clientID: process.env.CMD_BITBUCKET_CLIENTID,

0 commit comments

Comments
 (0)