From 83e4b9f9ce33f14ece5bf033c09f6a4010d5d1b5 Mon Sep 17 00:00:00 2001 From: nekolr Date: Tue, 21 Nov 2023 15:31:27 +0800 Subject: [PATCH] key generate --- src/main/java/com/nekolr/saber/security/jwt/TokenProvider.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/nekolr/saber/security/jwt/TokenProvider.java b/src/main/java/com/nekolr/saber/security/jwt/TokenProvider.java index 96814b8..8ceaacb 100644 --- a/src/main/java/com/nekolr/saber/security/jwt/TokenProvider.java +++ b/src/main/java/com/nekolr/saber/security/jwt/TokenProvider.java @@ -2,7 +2,6 @@ import io.jsonwebtoken.*; -import io.jsonwebtoken.security.Keys; import io.jsonwebtoken.security.SignatureException; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; @@ -22,7 +21,7 @@ public class TokenProvider { public TokenProvider(@Value("${jwt.period}") Duration period) { this.period = period; - this.secretKey = Keys.secretKeyFor(SignatureAlgorithm.HS256); + this.secretKey = Jwts.SIG.HS256.key().build(); } public String createToken(String username) {