summaryrefslogtreecommitdiff
path: root/src/server/api/service/github.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-04-13 19:19:32 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-04-13 19:19:32 +0900
commite369031a28a7aae390d17d4d9f075c6f0df7fe55 (patch)
tree4e0410685973c47b9c311f8a3ebf212310c9b701 /src/server/api/service/github.ts
parentFix bug (diff)
downloadsharkey-e369031a28a7aae390d17d4d9f075c6f0df7fe55.tar.gz
sharkey-e369031a28a7aae390d17d4d9f075c6f0df7fe55.tar.bz2
sharkey-e369031a28a7aae390d17d4d9f075c6f0df7fe55.zip
Redis必須に
Diffstat (limited to 'src/server/api/service/github.ts')
-rw-r--r--src/server/api/service/github.ts10
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));
});
});