diff --git a/src/main/java/com/j9/bestmoments/controller/AuthController.java b/src/main/java/com/j9/bestmoments/controller/AuthController.java index 003dc82..30c5173 100644 --- a/src/main/java/com/j9/bestmoments/controller/AuthController.java +++ b/src/main/java/com/j9/bestmoments/controller/AuthController.java @@ -16,8 +16,6 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -47,16 +45,16 @@ public ResponseEntity login(@PathVariable String registrationId, @Requ return ResponseEntity.ok(jwtToken); } - @PatchMapping("/logout") + @PatchMapping("/logout/{token}") @Operation(summary = "로그아웃", description = "토큰을 강제로 만료시킵니다.") - public ResponseEntity logout(@RequestBody String token) { + public ResponseEntity logout(@PathVariable String token) { tokenService.expire(token); return ResponseEntity.ok().body("로그아웃에 성공하였습니다."); } - @PatchMapping("/refresh") + @PatchMapping("/refresh/{refreshToken}") @Operation(summary = "액세스토큰 재발급", description = "리프래시 토큰을 통해 재발급받습니다.") - public ResponseEntity refreshToken(@RequestBody String refreshToken) { + public ResponseEntity refreshToken(@PathVariable String refreshToken) { String accessToken = tokenService.refresh(refreshToken); return ResponseEntity.ok().body(accessToken); }