Skip to content

Commit 04710db

Browse files
committed
fix: jwt 토큰 변경(512 -> 256)에 따른 키 생성 로직 수정
1 parent 0cb8230 commit 04710db

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

backend/src/main/java/com/example/ecommercewebservice/global/util/JwtTokenProvider.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,8 @@ public JwtTokenProvider(
6363
TokenRepository tokenRepository,
6464
UserRepository userRepository) {
6565

66-
// Base64로 인코딩된 시크릿 키를 디코딩하여 사용
67-
byte[] keyBytes = Decoders.BASE64.decode(secret);
68-
this.key = Keys.hmacShaKeyFor(keyBytes);
66+
// HS512 알고리즘에 맞는 안전한 키 생성
67+
this.key = Keys.secretKeyFor(SignatureAlgorithm.HS512);
6968
this.tokenValidityInMilliseconds = tokenValidityInSeconds * 1000;
7069
this.issuer = issuer;
7170
this.tokenRepository = tokenRepository;

0 commit comments

Comments
 (0)