From b5d6d213f36a9a0f996023d476625ccc69625194 Mon Sep 17 00:00:00 2001 From: sohot8653 Date: Tue, 26 Aug 2025 10:17:07 +0900 Subject: [PATCH] =?UTF-8?q?[=EB=A1=9C=EA=B7=B8=EC=95=84=EC=9B=83=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EA=B5=AC=ED=98=84=ED=98=84]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/member/controller/MemberController.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/bio/bio_backend/domain/base/member/controller/MemberController.java b/src/main/java/com/bio/bio_backend/domain/base/member/controller/MemberController.java index 88a7e92..d15c55f 100644 --- a/src/main/java/com/bio/bio_backend/domain/base/member/controller/MemberController.java +++ b/src/main/java/com/bio/bio_backend/domain/base/member/controller/MemberController.java @@ -21,6 +21,8 @@ import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; import com.bio.bio_backend.global.constants.ApiResponseCode; import com.bio.bio_backend.global.annotation.LogExecution; +import com.bio.bio_backend.global.utils.SecurityUtils; + @Tag(name = "Member", description = "회원 관련 API") @RestController @@ -55,12 +57,12 @@ public class MemberController { @ApiResponse(responseCode = "401", description = "인증 실패", content = @Content(schema = @Schema(implementation = ApiResponseDto.class))) }) @PostMapping("/logout") - public ResponseEntity> logout(@RequestHeader("Authorization") String authorization) { + public ResponseEntity> logout() { try { - // Authorization 헤더에서 토큰 추출 - String token = authorization.replace("Bearer ", ""); - // Refresh Token 삭제 (실제로는 JWT 블랙리스트나 DB에서 삭제) - // memberService.deleteRefreshToken(userId); + String userId = SecurityUtils.getCurrentUserId(); + memberService.deleteRefreshToken(userId); + + log.info("사용자 로그아웃 완료: {}", userId); return ResponseEntity.ok(ApiResponseDto.success(ApiResponseCode.COMMON_SUCCESS)); } catch (Exception e) {