diff options
Diffstat (limited to 'src/server/api/service/github.ts')
| -rw-r--r-- | src/server/api/service/github.ts | 10 |
1 files changed, 2 insertions, 8 deletions
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<any>((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<any>((res, rej) => { - redis!.get(userToken, async (_, state) => { + redis.get(userToken, async (_, state) => { res(JSON.parse(state)); }); }); |