diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-04-13 19:19:32 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-04-13 19:19:32 +0900 |
| commit | e369031a28a7aae390d17d4d9f075c6f0df7fe55 (patch) | |
| tree | 4e0410685973c47b9c311f8a3ebf212310c9b701 /src/server/api/service/twitter.ts | |
| parent | Fix bug (diff) | |
| download | sharkey-e369031a28a7aae390d17d4d9f075c6f0df7fe55.tar.gz sharkey-e369031a28a7aae390d17d4d9f075c6f0df7fe55.tar.bz2 sharkey-e369031a28a7aae390d17d4d9f075c6f0df7fe55.zip | |
Redis必須に
Diffstat (limited to 'src/server/api/service/twitter.ts')
| -rw-r--r-- | src/server/api/service/twitter.ts | 10 |
1 files changed, 2 insertions, 8 deletions
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<any>((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<any>((res, rej) => { - redis!.get(userToken, async (_, twCtx) => { + redis.get(userToken, async (_, twCtx) => { res(twCtx); }); }); |