From 64f134acd20d09e40c4cfb32e87b6516a596a535 Mon Sep 17 00:00:00 2001 From: jinddings Date: Thu, 21 Nov 2024 18:34:08 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20feat=20:=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=95=84=EC=9B=83=20api=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/auth/auth.controller.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/BE/src/auth/auth.controller.ts b/BE/src/auth/auth.controller.ts index 7e58a4bb..010d0a88 100644 --- a/BE/src/auth/auth.controller.ts +++ b/BE/src/auth/auth.controller.ts @@ -92,4 +92,14 @@ export class AuthController { check() { return { isLogin: true }; } + + @ApiOperation({ summary: '로그아웃 API' }) + @Get('/logout') + @UseGuards(AuthGuard('jwt')) + async logout(@Res() res: Response) { + res.clearCookie('accessToken'); + res.clearCookie('refreshToken'); + res.clearCookie('isRefreshToken'); + return res.status(200).json({ message: '로그아웃 성공' }); + } } From 2313d7f999be60b56c95e7ec5bbb5ec86e6c191f Mon Sep 17 00:00:00 2001 From: jinddings Date: Thu, 21 Nov 2024 18:37:51 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor=20:=20lint=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/auth/auth.controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BE/src/auth/auth.controller.ts b/BE/src/auth/auth.controller.ts index 010d0a88..88c7ad59 100644 --- a/BE/src/auth/auth.controller.ts +++ b/BE/src/auth/auth.controller.ts @@ -96,7 +96,7 @@ export class AuthController { @ApiOperation({ summary: '로그아웃 API' }) @Get('/logout') @UseGuards(AuthGuard('jwt')) - async logout(@Res() res: Response) { + logout(@Res() res: Response) { res.clearCookie('accessToken'); res.clearCookie('refreshToken'); res.clearCookie('isRefreshToken');