fix(go): set logout cache-control header+add check
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2023-09-04 15:22:17 +02:00
parent 4e17a6c911
commit fa1253a675
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI

@ -21,7 +21,9 @@ func Logout() echo.HandlerFunc {
log.Infof("max-age before logout: %d", sess.Options.MaxAge)
sess.Options.MaxAge = -1
if username := sess.Values["username"]; username != nil {
c.Response().Writer.Header().Set("Cache-Control", "no-store")
if username := sess.Values["username"]; username != nil && username.(string) != "" {
sess.Values["username"] = ""
}