mirror of
https://github.com/gotson/komga.git
synced 2025-12-20 07:23:34 +01:00
feat: remember-me validity can be configured using duration notation
you can use configurations like: - '30d' for 30 days - '24h' for 24 hours
This commit is contained in:
parent
e088c76c4e
commit
f592a9eda2
3 changed files with 5 additions and 5 deletions
|
|
@ -42,8 +42,8 @@ class KomgaProperties {
|
|||
@get:NotBlank
|
||||
var key: String? = null
|
||||
|
||||
@get:Positive
|
||||
var validity: Int = 1209600 // 2 weeks
|
||||
@DurationUnit(ChronoUnit.SECONDS)
|
||||
var validity: Duration = Duration.ofDays(14)
|
||||
}
|
||||
|
||||
class Cors {
|
||||
|
|
|
|||
|
|
@ -103,13 +103,13 @@ class SecurityConfiguration(
|
|||
}
|
||||
|
||||
if (!komgaProperties.rememberMe.key.isNullOrBlank()) {
|
||||
logger.info { "RememberMe is active, validity: ${komgaProperties.rememberMe.validity}s" }
|
||||
logger.info { "RememberMe is active, validity: ${komgaProperties.rememberMe.validity}" }
|
||||
|
||||
http
|
||||
.rememberMe {
|
||||
it.rememberMeServices(
|
||||
TokenBasedRememberMeServices(komgaProperties.rememberMe.key, komgaUserDetailsLifecycle).apply {
|
||||
setTokenValiditySeconds(komgaProperties.rememberMe.validity)
|
||||
setTokenValiditySeconds(komgaProperties.rememberMe.validity.seconds.toInt())
|
||||
setAlwaysRemember(true)
|
||||
setAuthenticationDetailsSource(userAgentWebAuthenticationDetailsSource)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
komga:
|
||||
remember-me:
|
||||
key: changeMe!
|
||||
validity: 2592000 # 1 month
|
||||
validity: 30d
|
||||
# libraries-scan-cron: "*/5 * * * * ?" #every 5 seconds
|
||||
libraries-scan-cron: "-" #disable
|
||||
libraries-scan-startup: false
|
||||
|
|
|
|||
Loading…
Reference in a new issue