Post

[Spring] React-Spring 통신, Jwt 토큰이 쿠키에서 undifined될 때

React-Spring 통신, Jwt 토큰이 쿠키에서 undifined될 때

Issue

  • Spring에서는 Jwt 토큰 생성과, 쿠키에 저장, 전달까지 완료된 상태
  • React에서 로그인 후 Jwt 토큰이 쿠키에 Authorization이름으로 저장되고 전달되지 않는 상황
  • undefined, name도 Authorization이 아닌 token으로 되어있다

image
image

해결과정

  • 서버단에서 JwtUtill.java 파일에서 중복되었던 인코딩 과정을 제거했다.
  • 클라이언트단에서 Jwt Authorization이름으로 token value값을 담아야한다
This post is licensed under CC BY 4.0 by the author.