server: return www-authenticate again on incorrect password

This commit is contained in:
Tulir Asokan 2024-10-19 16:13:55 +03:00
parent f252323b04
commit ad224073fe

View file

@ -166,7 +166,8 @@ func (gmx *Gomuks) Authenticate(w http.ResponseWriter, r *http.Request) {
gmx.writeTokenCookie(w)
w.WriteHeader(http.StatusCreated)
} else {
w.WriteHeader(http.StatusForbidden)
w.Header().Set("WWW-Authenticate", `Basic realm="gomuks web" charset="UTF-8"`)
w.WriteHeader(http.StatusUnauthorized)
}
}
}