From 9d14476a6ae8f9b69f595bf5ee2649d8f9a70e3e Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 6 Dec 2022 14:17:53 +0900 Subject: [PATCH] =?UTF-8?q?fix(server):=20cookie=E3=81=8C=E5=8F=96?= =?UTF-8?q?=E5=BE=97=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E3=81=AE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/server/api/integration/DiscordServerService.ts | 4 ++-- .../backend/src/server/api/integration/GithubServerService.ts | 2 +- .../src/server/api/integration/TwitterServerService.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/server/api/integration/DiscordServerService.ts b/packages/backend/src/server/api/integration/DiscordServerService.ts index e6e79f3d3..72e67edf3 100644 --- a/packages/backend/src/server/api/integration/DiscordServerService.ts +++ b/packages/backend/src/server/api/integration/DiscordServerService.ts @@ -13,8 +13,8 @@ import { GlobalEventService } from '@/core/GlobalEventService.js'; import { MetaService } from '@/core/MetaService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { FastifyReplyError } from '@/misc/fastify-reply-error.js'; -import { SigninService } from '../SigninService.js'; import { bindThis } from '@/decorators.js'; +import { SigninService } from '../SigninService.js'; @Injectable() export class DiscordServerService { @@ -140,7 +140,7 @@ export class DiscordServerService { const oauth2 = await getOAuth2(); if (!userToken) { - const sessid = request.cookies.get('signin_with_discord_sid'); + const sessid = request.cookies['signin_with_discord_sid']; if (!sessid) { throw new FastifyReplyError(400, 'invalid session'); diff --git a/packages/backend/src/server/api/integration/GithubServerService.ts b/packages/backend/src/server/api/integration/GithubServerService.ts index e6c42e1ee..cea4c6b98 100644 --- a/packages/backend/src/server/api/integration/GithubServerService.ts +++ b/packages/backend/src/server/api/integration/GithubServerService.ts @@ -138,7 +138,7 @@ export class GithubServerService { const oauth2 = await getOath2(); if (!userToken) { - const sessid = request.cookies.get('signin_with_github_sid'); + const sessid = request.cookies['signin_with_github_sid']; if (!sessid) { throw new FastifyReplyError(400, 'invalid session'); diff --git a/packages/backend/src/server/api/integration/TwitterServerService.ts b/packages/backend/src/server/api/integration/TwitterServerService.ts index 747f59c7a..688fa1a5b 100644 --- a/packages/backend/src/server/api/integration/TwitterServerService.ts +++ b/packages/backend/src/server/api/integration/TwitterServerService.ts @@ -13,8 +13,8 @@ import { GlobalEventService } from '@/core/GlobalEventService.js'; import { MetaService } from '@/core/MetaService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { FastifyReplyError } from '@/misc/fastify-reply-error.js'; -import { SigninService } from '../SigninService.js'; import { bindThis } from '@/decorators.js'; +import { SigninService } from '../SigninService.js'; @Injectable() export class TwitterServerService { @@ -127,7 +127,7 @@ export class TwitterServerService { const twAuth = await getTwAuth(); if (userToken == null) { - const sessid = request.cookies.get('signin_with_twitter_sid'); + const sessid = request.cookies['signin_with_twitter_sid']; if (sessid == null) { throw new FastifyReplyError(400, 'invalid session');