From 44a70d5819f33fac689331c7a737e6e27613439b Mon Sep 17 00:00:00 2001 From: hejin8307 Date: Thu, 9 May 2024 13:41:44 +0900 Subject: [PATCH] Fix: remove bearer (#1) --- .../java/com/hanaro/starbucks/controller/MemberController.java | 3 +-- .../java/com/hanaro/starbucks/controller/OrderController.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/hanaro/starbucks/controller/MemberController.java b/src/main/java/com/hanaro/starbucks/controller/MemberController.java index 3c84c35..cebc21f 100644 --- a/src/main/java/com/hanaro/starbucks/controller/MemberController.java +++ b/src/main/java/com/hanaro/starbucks/controller/MemberController.java @@ -71,7 +71,6 @@ public void deleteUser(@PathVariable int userIdx){ @GetMapping("/points") public PointResDto getUserPoint(@RequestHeader MultiValueMap headers){ - String originalToken = headers.getFirst("authorization"); - return memberService.getUserPoint(originalToken.substring(7, originalToken.length())); + return memberService.getUserPoint(headers.getFirst("authorization")); } } diff --git a/src/main/java/com/hanaro/starbucks/controller/OrderController.java b/src/main/java/com/hanaro/starbucks/controller/OrderController.java index 7aa7eb9..d75a5ce 100644 --- a/src/main/java/com/hanaro/starbucks/controller/OrderController.java +++ b/src/main/java/com/hanaro/starbucks/controller/OrderController.java @@ -42,9 +42,8 @@ public void deleteOrder(@PathVariable int orderIdx) { @PostMapping("") public void createOrder(@RequestHeader MultiValueMap headers, @RequestBody List dtos) { - String originalToken = headers.getFirst("authorization"); if(headers.containsKey("authorization") ){ - String token = originalToken.substring(7, originalToken.length()); + String token = headers.getFirst("authorization"); orderService.createOrder(token, dtos); }else{ orderService.createOrder("null", dtos);