mirror of
https://github.com/lukaszraczylo/traefikoidc.git
synced 2026-06-05 22:44:17 +00:00
Fix session handling and the redirection to the original URL incl. get parameters
This commit is contained in:
+5
-5
@@ -172,11 +172,11 @@ func (sm *SessionManager) GetSession(r *http.Request) (*SessionData, error) {
|
||||
|
||||
// Check for absolute session timeout
|
||||
if createdAt, ok := sessionData.mainSession.Values["created_at"].(int64); ok {
|
||||
if time.Since(time.Unix(createdAt, 0)) > absoluteSessionTimeout {
|
||||
sessionData.Clear(r, nil) // Clear expired session
|
||||
sm.sessionPool.Put(sessionData)
|
||||
return nil, fmt.Errorf("session expired")
|
||||
}
|
||||
if time.Since(time.Unix(createdAt, 0)) > absoluteSessionTimeout {
|
||||
// Session has expired
|
||||
sm.sessionPool.Put(sessionData)
|
||||
return nil, fmt.Errorf("session expired")
|
||||
}
|
||||
}
|
||||
|
||||
sessionData.accessSession, err = sm.store.Get(r, accessTokenCookie)
|
||||
|
||||
Reference in New Issue
Block a user