Skip to content

Commit

Permalink
[hotfix] sendError 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
JunRain2 committed Jun 5, 2024
1 parent bb83b28 commit a49390c
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
String refreshToken = jwtService.extractRefreshToken(request);
checkRefreshTokenAndReIssueAccessToken(response, refreshToken);

sendError(response, HttpServletResponse.SC_UNAUTHORIZED);
response.setStatus(SC_UNAUTHORIZED);
} catch (NotFoundTokenException e) {
checkAccessTokenAndAuthentication(request, response, filterChain);
}
Expand All @@ -70,9 +70,8 @@ private void checkAccessTokenAndAuthentication(HttpServletRequest request, HttpS
String email = jwtService.getEmail(request);
memberRepository.findByEmail(email).ifPresent(this::saveAuthentication);
} catch (Exception e) {
sendError(response, SC_FORBIDDEN);
}
finally {
response.setStatus(SC_FORBIDDEN);
} finally {
filterChain.doFilter(request, response);
}
}
Expand All @@ -91,12 +90,4 @@ private void saveAuthentication(Member myMember) {

SecurityContextHolder.getContext().setAuthentication(authentication);
}

private void sendError(HttpServletResponse response, int errorCode) {
try {
response.sendError(errorCode);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}

0 comments on commit a49390c

Please sign in to comment.