Make session refresh retries idempotent
Preserve the successor session for legitimate refresh retries so transient failures no longer revoke the user's session family.
This commit is contained in:
@@ -56,6 +56,10 @@ data class AppConfig(
|
||||
hmacSecret = config.secret("app.session.secret", production).toByteArray(),
|
||||
accessMinutes = config.positiveLong("app.session.accessMinutes"),
|
||||
refreshDays = config.positiveLong("app.session.refreshDays"),
|
||||
legacyRefreshReplaySeconds = config.positiveLong(
|
||||
"app.session.legacyRefreshReplaySeconds",
|
||||
30,
|
||||
),
|
||||
gatewayGrantDays = config.positiveLong("app.session.gatewayGrantDays", 30),
|
||||
)
|
||||
val encryption = EncryptionConfig(
|
||||
@@ -244,6 +248,9 @@ data class AppConfig(
|
||||
require(session.refreshDays in 1..365) {
|
||||
"app.session.refreshDays must be between 1 and 365"
|
||||
}
|
||||
require(session.legacyRefreshReplaySeconds in 5..120) {
|
||||
"app.session.legacyRefreshReplaySeconds must be between 5 and 120"
|
||||
}
|
||||
require(!production || providers.volcengine.credentialsAvailable) {
|
||||
"Production Volcengine credentials are missing"
|
||||
}
|
||||
@@ -380,6 +387,7 @@ data class SessionConfig(
|
||||
val hmacSecret: ByteArray,
|
||||
val accessMinutes: Long,
|
||||
val refreshDays: Long,
|
||||
val legacyRefreshReplaySeconds: Long = 30,
|
||||
val gatewayGrantDays: Long = 30,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user