mirror of
https://github.com/gotson/komga.git
synced 2025-01-09 04:08:00 +08:00
fix(api): expired sessions would not be destroyed
This commit is contained in:
parent
fa04d9511a
commit
5ecc9c6785
@ -10,6 +10,7 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity
|
||||
import org.springframework.security.config.annotation.web.builders.WebSecurity
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
|
||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
|
||||
import org.springframework.security.core.session.SessionRegistry
|
||||
import org.springframework.security.core.userdetails.UserDetailsService
|
||||
import org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest
|
||||
import org.springframework.security.oauth2.client.registration.InMemoryClientRegistrationRepository
|
||||
@ -33,6 +34,7 @@ class SecurityConfiguration(
|
||||
private val oidcUserService: OAuth2UserService<OidcUserRequest, OidcUser>,
|
||||
private val sessionCookieName: String,
|
||||
private val userAgentWebAuthenticationDetailsSource: WebAuthenticationDetailsSource,
|
||||
private val sessionRegistry: SessionRegistry,
|
||||
clientRegistrationRepository: InMemoryClientRegistrationRepository?,
|
||||
) : WebSecurityConfigurerAdapter() {
|
||||
|
||||
@ -71,6 +73,12 @@ class SecurityConfiguration(
|
||||
it.deleteCookies(sessionCookieName)
|
||||
it.invalidateHttpSession(true)
|
||||
}
|
||||
.sessionManagement { session ->
|
||||
session.sessionConcurrency {
|
||||
it.sessionRegistry(sessionRegistry)
|
||||
it.maximumSessions(-1)
|
||||
}
|
||||
}
|
||||
|
||||
if (oauth2Enabled) {
|
||||
http.oauth2Login { oauth2 ->
|
||||
|
Loading…
Reference in New Issue
Block a user