Skip to content

Commit

Permalink
Fix: modified token name (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
hejin8307 committed May 8, 2024
1 parent 706c005 commit 1d8e1d6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.filter.GenericFilterBean;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/hanaro/starbucks/config/JwtUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public Authentication getAuthentication(String token) {
); // 사용자 정보를 기반으로 토큰 생성
}

// http 요청에서 "X-AUTH-TOKEN" 헤더 값을 읽어오는 메소드
// http 요청에서 "TOKEN" 헤더 값을 읽어오는 메소드
public String resolveToken(HttpServletRequest request) {
return request.getHeader("X-AUTH-TOKEN");
return request.getHeader("TOKEN");
}

public boolean validateToken(String token){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.hanaro.starbucks.dto.orders.OrderEditReqDto;
import com.hanaro.starbucks.dto.orders.OrderResDto;
import com.hanaro.starbucks.service.OrderService;
import io.jsonwebtoken.Jwts;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

Expand All @@ -21,6 +22,7 @@ public class OrderController {
public List<OrderResDto> getOrders() {
return orderService.getOrders();
}

@GetMapping("/{orderIdx}")
public OrderResDto getOrder(@PathVariable int orderIdx) {
return orderService.getOrder(orderIdx);
Expand Down

0 comments on commit 1d8e1d6

Please sign in to comment.