counter: fix bug where anything but the right password worked

This commit is contained in:
Chris Sexton 2022-07-17 14:08:14 -04:00
parent df0b5d709b
commit 72c32e1c16
1 changed files with 1 additions and 1 deletions

View File

@ -205,7 +205,7 @@ func (p *CounterPlugin) handleCounterAPI(w http.ResponseWriter, r *http.Request)
log.Debug().
Interface("postbody", info).
Msg("Got a POST")
if p.b.CheckPassword("", info.Password) {
if !p.b.CheckPassword("", info.Password) {
w.WriteHeader(http.StatusForbidden)
j, _ := json.Marshal(struct{ Err string }{Err: "Invalid Password"})
w.Write(j)