From caf7e4c6857d34109544572e54b2a20e89aaf0fa Mon Sep 17 00:00:00 2001 From: 70825 Date: Fri, 28 Jul 2023 17:44:29 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=A1=9C=EA=B7=B8=EC=95=84=EC=9B=83=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/funeat/auth/presentation/AuthController.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/src/main/java/com/funeat/auth/presentation/AuthController.java b/backend/src/main/java/com/funeat/auth/presentation/AuthController.java index 6c6093f4f..21de92552 100644 --- a/backend/src/main/java/com/funeat/auth/presentation/AuthController.java +++ b/backend/src/main/java/com/funeat/auth/presentation/AuthController.java @@ -1,7 +1,9 @@ package com.funeat.auth.presentation; import com.funeat.auth.application.AuthService; +import com.funeat.auth.dto.LoginRequest; import com.funeat.auth.dto.SignUserDto; +import com.funeat.auth.util.AuthenticationPrincipal; import java.net.URI; import javax.servlet.http.HttpServletRequest; import org.springframework.http.HttpStatus; @@ -42,4 +44,12 @@ public ResponseEntity loginAuthorizeUser(@RequestParam("code") final Strin .location(URI.create("/profile")) .build(); } + + @GetMapping("/api/logout") + public ResponseEntity logout(@AuthenticationPrincipal final LoginRequest loginRequest, + final HttpServletRequest request) { + request.getSession().removeAttribute("member"); + + return ResponseEntity.ok().build(); + } }