From e369031a28a7aae390d17d4d9f075c6f0df7fe55 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 13 Apr 2019 19:19:32 +0900 Subject: Redis必須に MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/api/service/github.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/server/api/service/github.ts') diff --git a/src/server/api/service/github.ts b/src/server/api/service/github.ts index 4878d8c529..a4d274cc62 100644 --- a/src/server/api/service/github.ts +++ b/src/server/api/service/github.ts @@ -80,8 +80,6 @@ async function getOath2() { } router.get('/connect/github', async ctx => { - if (redis == null) return; - if (!compareOrigin(ctx)) { ctx.throw(400, 'invalid origin'); return; @@ -106,8 +104,6 @@ router.get('/connect/github', async ctx => { }); router.get('/signin/github', async ctx => { - if (redis == null) return; - const sessid = uuid(); const params = { @@ -133,8 +129,6 @@ router.get('/signin/github', async ctx => { }); router.get('/gh/cb', async ctx => { - if (redis == null) return; - const userToken = getUserToken(ctx); const oauth2 = await getOath2(); @@ -155,7 +149,7 @@ router.get('/gh/cb', async ctx => { } const { redirect_uri, state } = await new Promise((res, rej) => { - redis!.get(sessid, async (_, state) => { + redis.get(sessid, async (_, state) => { res(JSON.parse(state)); }); }); @@ -222,7 +216,7 @@ router.get('/gh/cb', async ctx => { } const { redirect_uri, state } = await new Promise((res, rej) => { - redis!.get(userToken, async (_, state) => { + redis.get(userToken, async (_, state) => { res(JSON.parse(state)); }); }); -- cgit v1.2.3-freya