에러 메시지 :

io.jsonwebtoken.ExpiredJwtException: JWT expired 1459150 milliseconds ago at 2024-05-30T05:54:13.000Z. Current time: 2024-05-30T06:18:32.150Z. Allowed clock skew: 0 milliseconds.

원인 1 :

return Jwts.builder()
					.claim("email", email)
          .claim("roles", roles)
          .issuedAt(new Date(System.currentTimeMillis()))
          .expiration(new Date(System.currentTimeMillis() + expiredMs))
          .signWith(secretKey)
          .compact();

expiration에 너무 큰 값이 들어가면 Integer overflow가 떠 음수가 되어버리는 현상이 나타나고, 현재 시각 이전의 시각이 만료 시각으로 들어감.

해결 방안 :

expiredMs에 .toLong()을 붙여 큰 값이 들어 갈 수 있게 해주기.

참고 레퍼런스 :

Adding a large timestamp to the current time in Java

원인 2 : Postman의 쿠키에 만료된 JWT가 들어있는 경우

해결 방안 : Postman 우측 상단의 Cookie로 들어가서 localhost의 쿠키 삭제