Skip to content

Commit

Permalink
Merge pull request #127 from 22caps/dev
Browse files Browse the repository at this point in the history
머지요
  • Loading branch information
GiHoo authored Nov 25, 2024
2 parents 2d890c1 + 98e062f commit 6dd1005
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@
public class JwtAuthenticationFilter extends GenericFilterBean {

private static final String AUTHORIZATION_HEADER = "Authorization";
private static final String TOKEN_PREFIX = "Bearer ";
private final JwtProvider jwtProvider;
private static final String TOKEN_PREFIX = "Bearer";
private final JwtProvider jwtTokenProvider;

@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
String token = resolveToken((HttpServletRequest) request);

if (token != null && jwtProvider.validateToken(token)) {
Authentication authentication = jwtProvider.getAuthentication(token);
if (token != null && jwtTokenProvider.validateToken(token)) {
Authentication authentication = jwtTokenProvider.getAuthentication(token);
SecurityContextHolder.getContext().setAuthentication(authentication);

chain.doFilter(request, response);
}

chain.doFilter(request, response);
}

private String resolveToken(HttpServletRequest request) {
Expand Down

0 comments on commit 6dd1005

Please sign in to comment.