Skip to content

Commit

Permalink
refactor: (#68) 시크릿 키 디코딩 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
aiaiaiai1 committed Jul 20, 2023
1 parent a5e9740 commit 7848b8a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import io.jsonwebtoken.io.Decoders;
import io.jsonwebtoken.security.Keys;
import io.jsonwebtoken.security.SignatureException;

import java.nio.charset.StandardCharsets;
import java.security.Key;
import java.util.Date;
import lombok.extern.slf4j.Slf4j;
Expand All @@ -36,7 +38,7 @@ public TokenProcessor(
@Value("${jwt.token.expiration-time}") final int tokenExpirationTime,
final ObjectMapper objectMapper
) {
this.key = Keys.hmacShaKeyFor(Decoders.BASE64.decode(secretKey));
this.key = Keys.hmacShaKeyFor(secretKey.getBytes(StandardCharsets.UTF_8));
this.tokenExpirationTime = tokenExpirationTime;
this.objectMapper = objectMapper;
}
Expand Down

0 comments on commit 7848b8a

Please sign in to comment.