Skip to content

Commit

Permalink
Chore: 토큰에서 추출한 memberId가 null일 경우 예외
Browse files Browse the repository at this point in the history
  • Loading branch information
yugyeom-ghim committed Nov 13, 2024
1 parent 3cdcbff commit 15577cf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/notai/common/config/AuthInterceptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons
String token = header.substring(BEARER_PREFIX_LENGTH);
try {
Long memberId = tokenService.extractMemberId(token);
if (memberId == null) {
throw new UnAuthorizedException(INVALID_ACCESS_TOKEN);
}

request.setAttribute("memberId", memberId);
} catch (Exception e) {
throw new UnAuthorizedException(INVALID_ACCESS_TOKEN);
Expand Down

0 comments on commit 15577cf

Please sign in to comment.