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) {