forked from SteamWar/SteamWar
Reduce access token duration and enhance auth endpoints
This commit is contained in:
@@ -23,7 +23,6 @@ import de.steamwar.sql.Token
|
||||
import java.time.LocalDateTime
|
||||
import kotlin.time.Duration
|
||||
import kotlin.time.Duration.Companion.days
|
||||
import kotlin.time.Duration.Companion.hours
|
||||
import kotlin.time.Duration.Companion.minutes
|
||||
import kotlin.time.toJavaDuration
|
||||
|
||||
@@ -38,7 +37,7 @@ val Token.type: TokenType
|
||||
val TokenType.lifetime: Duration
|
||||
get() = when (this) {
|
||||
TokenType.REFRESH_TOKEN -> 7.days
|
||||
TokenType.ACCESS_TOKEN -> 1.hours
|
||||
TokenType.ACCESS_TOKEN -> 5.minutes
|
||||
TokenType.RESET_PASSWORD -> 10.minutes
|
||||
TokenType.OLD_TOKEN -> 1.days
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user