From 4e0563b022f0934aa64da483e0d9f7bdf627153b Mon Sep 17 00:00:00 2001 From: songbuild00 Date: Thu, 28 Nov 2024 22:45:49 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20CORS=20origin=20=EC=A7=81=EC=A0=91?= =?UTF-8?q?=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/game/game.gateway.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/BE/src/game/game.gateway.ts b/BE/src/game/game.gateway.ts index 9ec1327..858f643 100644 --- a/BE/src/game/game.gateway.ts +++ b/BE/src/game/game.gateway.ts @@ -31,12 +31,13 @@ import { ExceptionMessage } from '../common/constants/exception-message'; @UseInterceptors(GameActivityInterceptor) @UseFilters(new WsExceptionFilter()) @WebSocketGateway({ - // cors: { - // origin: ['*,', 'https://admin.socket.io'], //이러면 배포에서 cors오류 생김 - // credentials: true - // }, cors: { - origin: '*' //이러면 배포에서 admin ui 접근 안됨 + origin: [ + 'https://news.taskify.shop', + 'https://quizground.duckdns.org', + 'https://admin.socket.io' + ], + credentials: true }, namespace: '/game' }) From 42c834bde86bea752bf1602ba1f126ef88c5b41c Mon Sep 17 00:00:00 2001 From: songbuild00 Date: Thu, 28 Nov 2024 22:46:56 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20Set-Cookie=20SameSite,=20Secure=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/game/game.gateway.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BE/src/game/game.gateway.ts b/BE/src/game/game.gateway.ts index 858f643..531b2e4 100644 --- a/BE/src/game/game.gateway.ts +++ b/BE/src/game/game.gateway.ts @@ -180,7 +180,7 @@ export class GameGateway { setNewPlayerIdToCookie(headers) { const playerId = uuidv4(); - headers['Set-Cookie'] = serialize('playerId', playerId); + headers['Set-Cookie'] = serialize('playerId', playerId, { sameSite: 'none', secure: true }); return playerId; }