diff --git a/src/main/java/com/mpnp/baechelin/user/controller/UserController.java b/src/main/java/com/mpnp/baechelin/user/controller/UserController.java index cd1e8db..80bd345 100644 --- a/src/main/java/com/mpnp/baechelin/user/controller/UserController.java +++ b/src/main/java/com/mpnp/baechelin/user/controller/UserController.java @@ -1,13 +1,15 @@ package com.mpnp.baechelin.user.controller; -import com.mpnp.baechelin.login.oauth.common.AuthResponse; import com.mpnp.baechelin.user.service.UserService; -import io.swagger.annotations.ApiOperation; +import com.mpnp.baechelin.util.CookieUtil; import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.security.core.annotation.AuthenticationPrincipal; -import org.springframework.security.core.userdetails.User; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; @RestController @RequestMapping("/user") @@ -17,7 +19,8 @@ public class UserController { private final UserService userService; @RequestMapping("/logout") - public ResponseEntity logout(@AuthenticationPrincipal User user) { - return null; + public ResponseEntity logout(HttpServletRequest request, HttpServletResponse response) { + CookieUtil.deleteCookie(request, response, "refresh_token"); + return new ResponseEntity<>("로그아웃 완료", HttpStatus.OK); } }