Skip to content

Commit

Permalink
FIX : request헤더에서 토큰정보를 가져오도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
juwum12 committed Apr 9, 2024
1 parent eac01d8 commit 3e23f40
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import com.nawabali.nawabali.repository.UserRepository;
import com.nawabali.nawabali.security.UserDetailsServiceImpl;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwt;
import io.netty.util.internal.StringUtil;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.Cookie;
Expand Down Expand Up @@ -38,11 +36,12 @@ public class JwtAuthorizationFilter extends OncePerRequestFilter {

@Override
protected void doFilterInternal(HttpServletRequest req, HttpServletResponse res, FilterChain filterChain) throws ServletException, IOException {
String accessToken = jwtUtil.getTokenFromCookieAndName(req, JwtUtil.AUTHORIZATION_HEADER);
// String accessToken = jwtUtil.getTokenFromCookieAndName(req, JwtUtil.AUTHORIZATION_HEADER);
String accessToken = jwtUtil.getJwtFromHeader(req);
// log.info("accessToken : "+ accessToken);
if(StringUtils.hasText(accessToken)){
// 토큰 유무 확인
accessToken = jwtUtil.substringToken(accessToken);
// accessToken = jwtUtil.substringToken(accessToken);
String refreshToken =redisTool.getValues(accessToken);
log.info("저장된 refreshToken :" + refreshToken);

Expand Down

0 comments on commit 3e23f40

Please sign in to comment.