diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-03-24 11:34:29 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-03-24 11:34:29 +0900 |
| commit | 3e11011229ef8459747acdf6d3008dc145280fec (patch) | |
| tree | 8ebc85727c4d295f6583b63d9397651151d4394a /src/server/api/service | |
| parent | Merge branch 'develop' (diff) | |
| parent | 12.75.1 (diff) | |
| download | misskey-3e11011229ef8459747acdf6d3008dc145280fec.tar.gz misskey-3e11011229ef8459747acdf6d3008dc145280fec.tar.bz2 misskey-3e11011229ef8459747acdf6d3008dc145280fec.zip | |
Merge branch 'develop'
Diffstat (limited to 'src/server/api/service')
| -rw-r--r-- | src/server/api/service/discord.ts | 16 | ||||
| -rw-r--r-- | src/server/api/service/github.ts | 16 | ||||
| -rw-r--r-- | src/server/api/service/twitter.ts | 14 |
3 files changed, 23 insertions, 23 deletions
diff --git a/src/server/api/service/discord.ts b/src/server/api/service/discord.ts index fce840cde5..a684e71fc6 100644 --- a/src/server/api/service/discord.ts +++ b/src/server/api/service/discord.ts @@ -1,13 +1,13 @@ import * as Koa from 'koa'; import * as Router from '@koa/router'; -import { getJson } from '../../../misc/fetch'; +import { getJson } from '@/misc/fetch'; import { OAuth2 } from 'oauth'; -import config from '../../../config'; +import config from '@/config'; import { publishMainStream } from '../../../services/stream'; -import redis from '../../../db/redis'; +import { redisClient } from '../../../db/redis'; import { v4 as uuid } from 'uuid'; import signin from '../common/signin'; -import { fetchMeta } from '../../../misc/fetch-meta'; +import { fetchMeta } from '@/misc/fetch-meta'; import { Users, UserProfiles } from '../../../models'; import { ILocalUser } from '../../../models/entities/user'; @@ -96,7 +96,7 @@ router.get('/connect/discord', async ctx => { response_type: 'code' }; - redis.set(userToken, JSON.stringify(params)); + redisClient.set(userToken, JSON.stringify(params)); const oauth2 = await getOAuth2(); ctx.redirect(oauth2!.getAuthorizeUrl(params)); @@ -118,7 +118,7 @@ router.get('/signin/discord', async ctx => { httpOnly: true }); - redis.set(sessid, JSON.stringify(params)); + redisClient.set(sessid, JSON.stringify(params)); const oauth2 = await getOAuth2(); ctx.redirect(oauth2!.getAuthorizeUrl(params)); @@ -145,7 +145,7 @@ router.get('/dc/cb', async ctx => { } const { redirect_uri, state } = await new Promise<any>((res, rej) => { - redis.get(sessid, async (_, state) => { + redisClient.get(sessid, async (_, state) => { res(JSON.parse(state)); }); }); @@ -216,7 +216,7 @@ router.get('/dc/cb', async ctx => { } const { redirect_uri, state } = await new Promise<any>((res, rej) => { - redis.get(userToken, async (_, state) => { + redisClient.get(userToken, async (_, state) => { res(JSON.parse(state)); }); }); diff --git a/src/server/api/service/github.ts b/src/server/api/service/github.ts index 2b10fa02a0..12435b7e81 100644 --- a/src/server/api/service/github.ts +++ b/src/server/api/service/github.ts @@ -1,13 +1,13 @@ import * as Koa from 'koa'; import * as Router from '@koa/router'; -import { getJson } from '../../../misc/fetch'; +import { getJson } from '@/misc/fetch'; import { OAuth2 } from 'oauth'; -import config from '../../../config'; +import config from '@/config'; import { publishMainStream } from '../../../services/stream'; -import redis from '../../../db/redis'; +import { redisClient } from '../../../db/redis'; import { v4 as uuid } from 'uuid'; import signin from '../common/signin'; -import { fetchMeta } from '../../../misc/fetch-meta'; +import { fetchMeta } from '@/misc/fetch-meta'; import { Users, UserProfiles } from '../../../models'; import { ILocalUser } from '../../../models/entities/user'; @@ -95,7 +95,7 @@ router.get('/connect/github', async ctx => { state: uuid() }; - redis.set(userToken, JSON.stringify(params)); + redisClient.set(userToken, JSON.stringify(params)); const oauth2 = await getOath2(); ctx.redirect(oauth2!.getAuthorizeUrl(params)); @@ -116,7 +116,7 @@ router.get('/signin/github', async ctx => { httpOnly: true }); - redis.set(sessid, JSON.stringify(params)); + redisClient.set(sessid, JSON.stringify(params)); const oauth2 = await getOath2(); ctx.redirect(oauth2!.getAuthorizeUrl(params)); @@ -143,7 +143,7 @@ router.get('/gh/cb', async ctx => { } const { redirect_uri, state } = await new Promise<any>((res, rej) => { - redis.get(sessid, async (_, state) => { + redisClient.get(sessid, async (_, state) => { res(JSON.parse(state)); }); }); @@ -194,7 +194,7 @@ router.get('/gh/cb', async ctx => { } const { redirect_uri, state } = await new Promise<any>((res, rej) => { - redis.get(userToken, async (_, state) => { + redisClient.get(userToken, async (_, state) => { res(JSON.parse(state)); }); }); diff --git a/src/server/api/service/twitter.ts b/src/server/api/service/twitter.ts index 97e9d3a7fc..8520a5656f 100644 --- a/src/server/api/service/twitter.ts +++ b/src/server/api/service/twitter.ts @@ -2,11 +2,11 @@ import * as Koa from 'koa'; import * as Router from '@koa/router'; import { v4 as uuid } from 'uuid'; import autwh from 'autwh'; -import redis from '../../../db/redis'; +import { redisClient } from '../../../db/redis'; import { publishMainStream } from '../../../services/stream'; -import config from '../../../config'; +import config from '@/config'; import signin from '../common/signin'; -import { fetchMeta } from '../../../misc/fetch-meta'; +import { fetchMeta } from '@/misc/fetch-meta'; import { Users, UserProfiles } from '../../../models'; import { ILocalUser } from '../../../models/entities/user'; @@ -89,7 +89,7 @@ router.get('/connect/twitter', async ctx => { const twAuth = await getTwAuth(); const twCtx = await twAuth!.begin(); - redis.set(userToken, JSON.stringify(twCtx)); + redisClient.set(userToken, JSON.stringify(twCtx)); ctx.redirect(twCtx.url); }); @@ -99,7 +99,7 @@ router.get('/signin/twitter', async ctx => { const sessid = uuid(); - redis.set(sessid, JSON.stringify(twCtx)); + redisClient.set(sessid, JSON.stringify(twCtx)); ctx.cookies.set('signin_with_twitter_sid', sessid, { path: '/', @@ -124,7 +124,7 @@ router.get('/tw/cb', async ctx => { } const get = new Promise<any>((res, rej) => { - redis.get(sessid, async (_, twCtx) => { + redisClient.get(sessid, async (_, twCtx) => { res(twCtx); }); }); @@ -153,7 +153,7 @@ router.get('/tw/cb', async ctx => { } const get = new Promise<any>((res, rej) => { - redis.get(userToken, async (_, twCtx) => { + redisClient.get(userToken, async (_, twCtx) => { res(twCtx); }); }); |