Another attempt to fix the issue with expired session.

This commit is contained in:
2024-10-03 14:00:43 +01:00
parent 38433dfff8
commit e97d8e15ff
2 changed files with 7 additions and 10 deletions
+2 -7
View File
@@ -275,12 +275,7 @@ func (t *TraefikOidc) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
authenticated, needsRefresh, expired := t.isUserAuthenticated(session)
if expired {
t.handleExpiredToken(rw, req, session)
return
}
if !authenticated {
if expired || !authenticated {
t.initiateAuthentication(rw, req, session, t.redirectURL)
return
}
@@ -288,7 +283,7 @@ func (t *TraefikOidc) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
if needsRefresh {
refreshed := t.refreshToken(rw, req, session)
if !refreshed {
t.handleExpiredToken(rw, req, session)
t.initiateAuthentication(rw, req, session, t.redirectURL)
return
}
}