This commit is contained in:
Hayden 2022-08-30 16:07:05 -08:00
parent 9c1cced576
commit 5471cb16ff

View file

@ -31,9 +31,9 @@ func (ctrl *V1Controller) HandleAuthLogin() http.HandlerFunc {
if r.Header.Get("Content-Type") == HeaderFormData { if r.Header.Get("Content-Type") == HeaderFormData {
err := r.ParseForm() err := r.ParseForm()
if err != nil { if err != nil {
server.Respond(w, http.StatusBadRequest, server.Wrap(err)) server.Respond(w, http.StatusBadRequest, server.Wrap(err))
ctrl.log.Error(errors.New("failed to decode login form (FORM)"), logger.Props{"error": err.Error()})
return return
} }
@ -43,6 +43,9 @@ func (ctrl *V1Controller) HandleAuthLogin() http.HandlerFunc {
err := server.Decode(r, loginForm) err := server.Decode(r, loginForm)
if err != nil { if err != nil {
ctrl.log.Error(errors.New("failed to decode login form (JSON)"), logger.Props{
"error": err.Error(),
})
server.Respond(w, http.StatusBadRequest, server.Wrap(err)) server.Respond(w, http.StatusBadRequest, server.Wrap(err))
return return
} }
@ -99,7 +102,7 @@ func (ctrl *V1Controller) HandleAuthLogout() http.HandlerFunc {
return return
} }
err = server.Respond(w, http.StatusNoContent, nil) server.Respond(w, http.StatusNoContent, nil)
} }
} }