File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed
src/main/kotlin/osahner/security Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -20,15 +20,14 @@ class TokenProvider(
20
20
private val userDetailsService : AppUserDetailsService ,
21
21
) {
22
22
private var key: SecretKey ? = null
23
- private var tokenValidity: Date ? = null
24
23
25
24
@PostConstruct
26
25
fun init () {
27
26
key = Keys .hmacShaKeyFor(securityProperties.secret.toByteArray())
28
- tokenValidity = Date ().add(Calendar .DAY_OF_MONTH , securityProperties.expirationTime)
29
27
}
30
28
31
29
fun createToken (authentication : Authentication ): String {
30
+ val tokenValidity = Date ().add(Calendar .DAY_OF_MONTH , securityProperties.expirationTime)
32
31
val authClaims: MutableList <String > = mutableListOf ()
33
32
authentication.authorities?.let { authorities ->
34
33
authorities.forEach { claim -> authClaims.add(claim.toString()) }
You can’t perform that action at this time.
0 commit comments