mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
Fixed session expiration
This commit is contained in:
+5
-1
@@ -28,7 +28,11 @@ func isUserLoggedIn(user User) bool {
|
||||
if hash1 != hash2 {
|
||||
continue
|
||||
}
|
||||
return !isSessionExpired(SESSIONS[i])
|
||||
sessionExpired := isSessionExpired(SESSIONS[i])
|
||||
if sessionExpired {
|
||||
removeSession(user)
|
||||
}
|
||||
return !sessionExpired
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -43,9 +43,7 @@ func removeSession(user User) {
|
||||
break
|
||||
}
|
||||
}
|
||||
fmt.Println(SESSIONS)
|
||||
SESSIONS[index] = SESSIONS[sessLen-1]
|
||||
SESSIONS[sessLen-1] = Session{}
|
||||
SESSIONS = SESSIONS[:sessLen-1]
|
||||
fmt.Println(SESSIONS)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user