Skip to content

Commit

Permalink
[#38] refactor: 중복되는 validation 로직 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
hsik0225 committed Jun 5, 2020
1 parent 3c855ff commit eeb24d4
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@ public boolean preHandle(HttpServletRequest request,

Cookie[] cookies = request.getCookies();
validateCookies(cookies);

Cookie cookie = Arrays.stream(request.getCookies())
.filter(c -> c.getName().equals("jwt"))
.findFirst()
.orElseThrow(() -> new IllegalArgumentException("JWT 쿠키가 없습니다!"));

return decrypt(cookie.getValue()) != null;
return true;
}

private void validateCookies(Cookie[] cookies) {
Expand Down

0 comments on commit eeb24d4

Please sign in to comment.