diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-12-09 23:58:30 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-12-09 23:58:30 +0900 |
| commit | c69b72e1999578cba15e34677ebd366482cba734 (patch) | |
| tree | 624ac6500e36e3a7024a5ea19ae891ef86781d04 /packages/backend/src/server/api/service/github.ts | |
| parent | Update instance-mute.vue (diff) | |
| download | sharkey-c69b72e1999578cba15e34677ebd366482cba734.tar.gz sharkey-c69b72e1999578cba15e34677ebd366482cba734.tar.bz2 sharkey-c69b72e1999578cba15e34677ebd366482cba734.zip | |
fix lint
Diffstat (limited to 'packages/backend/src/server/api/service/github.ts')
| -rw-r--r-- | packages/backend/src/server/api/service/github.ts | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/backend/src/server/api/service/github.ts b/packages/backend/src/server/api/service/github.ts index 07b4fe717e..5e0839df93 100644 --- a/packages/backend/src/server/api/service/github.ts +++ b/packages/backend/src/server/api/service/github.ts @@ -92,7 +92,7 @@ router.get('/connect/github', async ctx => { const params = { redirect_uri: `${config.url}/api/gh/cb`, scope: ['read:user'], - state: uuid() + state: uuid(), }; redisClient.set(userToken, JSON.stringify(params)); @@ -107,13 +107,13 @@ router.get('/signin/github', async ctx => { const params = { redirect_uri: `${config.url}/api/gh/cb`, scope: ['read:user'], - state: uuid() + state: uuid(), }; ctx.cookies.set('signin_with_github_sid', sessid, { path: '/', secure: config.url.startsWith('https'), - httpOnly: true + httpOnly: true, }); redisClient.set(sessid, JSON.stringify(params)); @@ -155,7 +155,7 @@ router.get('/gh/cb', async ctx => { const { accessToken } = await new Promise<any>((res, rej) => oauth2!.getOAuthAccessToken(code, { - redirect_uri + redirect_uri, }, (err, accessToken, refresh, result) => { if (err) { rej(err); @@ -167,7 +167,7 @@ router.get('/gh/cb', async ctx => { })); const { login, id } = await getJson('https://api.github.com/user', 'application/vnd.github.v3+json', 10 * 1000, { - 'Authorization': `bearer ${accessToken}` + 'Authorization': `bearer ${accessToken}`, }); if (!login || !id) { ctx.throw(400, 'invalid session'); @@ -219,7 +219,7 @@ router.get('/gh/cb', async ctx => { })); const { login, id } = await getJson('https://api.github.com/user', 'application/vnd.github.v3+json', 10 * 1000, { - 'Authorization': `bearer ${accessToken}` + 'Authorization': `bearer ${accessToken}`, }); if (!login || !id) { @@ -229,7 +229,7 @@ router.get('/gh/cb', async ctx => { const user = await Users.findOneOrFail({ host: null, - token: userToken + token: userToken, }); const profile = await UserProfiles.findOneOrFail(user.id); @@ -241,8 +241,8 @@ router.get('/gh/cb', async ctx => { accessToken: accessToken, id: id, login: login, - } - } + }, + }, }); ctx.body = `GitHub: @${login} を、Misskey: @${user.username} に接続しました!`; @@ -250,7 +250,7 @@ router.get('/gh/cb', async ctx => { // Publish i updated event publishMainStream(user.id, 'meUpdated', await Users.pack(user, user, { detail: true, - includeSecrets: true + includeSecrets: true, })); } }); |