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/twitter.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/server/api/service/twitter.ts') diff --git a/src/server/api/service/twitter.ts b/src/server/api/service/twitter.ts index b35ee8c479..39fdfd8654 100644 --- a/src/server/api/service/twitter.ts +++ b/src/server/api/service/twitter.ts @@ -79,8 +79,6 @@ async function getTwAuth() { } router.get('/connect/twitter', async ctx => { - if (redis == null) return; - if (!compareOrigin(ctx)) { ctx.throw(400, 'invalid origin'); return; @@ -99,8 +97,6 @@ router.get('/connect/twitter', async ctx => { }); router.get('/signin/twitter', async ctx => { - if (redis == null) return; - const twAuth = await getTwAuth(); const twCtx = await twAuth!.begin(); @@ -122,8 +118,6 @@ router.get('/signin/twitter', async ctx => { }); router.get('/tw/cb', async ctx => { - if (redis == null) return; - const userToken = getUserToken(ctx); const twAuth = await getTwAuth(); @@ -137,7 +131,7 @@ router.get('/tw/cb', async ctx => { } const get = new Promise((res, rej) => { - redis!.get(sessid, async (_, twCtx) => { + redis.get(sessid, async (_, twCtx) => { res(twCtx); }); }); @@ -170,7 +164,7 @@ router.get('/tw/cb', async ctx => { } const get = new Promise((res, rej) => { - redis!.get(userToken, async (_, twCtx) => { + redis.get(userToken, async (_, twCtx) => { res(twCtx); }); }); -- cgit v1.2.3-freya