Fix: JwtUtil - fix general key bug
This commit is contained in:
@@ -59,7 +59,7 @@ fun main(args: Array<String>) {
|
||||
OxygenApiApplication::class.java.getResource("/application-config-template.yml")?.readText()?.let {
|
||||
File("data/application-config.example.yml").writeText(
|
||||
it.replace(
|
||||
"\$uuid\$", UUID.randomUUID().toString().replace("-", "")
|
||||
"\$uuid\$", UUID.randomUUID().toString()
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ object JwtUtil {
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private fun generalKey(): SecretKeySpec {
|
||||
val encodeKey = Base64.getDecoder().decode(SecurityProperties.jwtKey)
|
||||
val encodeKey = Base64.getEncoder().encode(SecurityProperties.jwtKey.toByteArray())
|
||||
return SecretKeySpec(encodeKey, 0, encodeKey.size, "AES")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user