From 8240b71657ec3dea1338b2885bf8f06362b878a4 Mon Sep 17 00:00:00 2001 From: SJ70 Date: Tue, 23 Jul 2024 19:06:27 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=AC=B4=ED=95=9C=20=ED=98=B8=EC=B6=9C?= =?UTF-8?q?=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - String을 body로 받지 않고 파라미터로 받게 함 --- .../com/j9/bestmoments/controller/AuthController.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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); }