1
0
Fork 0
forked from Mirrors/gomuks

server: remove cookie if it's invalid

This commit is contained in:
Tulir Asokan 2024-10-19 16:15:39 +03:00
parent ad224073fe
commit 8e92d9b163

View file

@ -213,6 +213,10 @@ func (gmx *Gomuks) AuthMiddleware(next http.Handler) http.Handler {
ErrMissingCookie.Write(w)
return
} else if !gmx.validateAuth(authCookie.Value, false) {
http.SetCookie(w, &http.Cookie{
Name: "gomuks_auth",
MaxAge: -1,
})
ErrInvalidCookie.Write(w)
return
}