Adds JWT secret, turns on Swagger UI, and cleans up refresh token response
This commit is contained in:
@@ -7,11 +7,12 @@ import org.springframework.beans.factory.annotation.Value
|
||||
import org.springframework.stereotype.Component
|
||||
import java.util.Date
|
||||
import javax.crypto.SecretKey
|
||||
import javax.crypto.spec.SecretKeySpec
|
||||
|
||||
@Component
|
||||
class JwtUtil {
|
||||
@Value($$"${jwt.secret}")
|
||||
private val jwtSecret: String? = null
|
||||
private val jwtSecret: String = ""
|
||||
|
||||
@Value($$"${jwt.expiration}")
|
||||
private val jwtExpirationMs = 0
|
||||
@@ -22,7 +23,7 @@ class JwtUtil {
|
||||
// preventing the repeated creation of the key and enhancing performance
|
||||
@PostConstruct
|
||||
fun init() {
|
||||
this.key = Jwts.SIG.HS256.key().build()
|
||||
this.key = SecretKeySpec(jwtSecret.toByteArray(Charsets.UTF_8), "HmacSHA256")
|
||||
}
|
||||
|
||||
// Generate JWT token
|
||||
|
||||
Reference in New Issue
Block a user