From 9d6f86a90fbb553f081d72c874ad3b751e5501d1 Mon Sep 17 00:00:00 2001 From: ArielLeyva Date: Sat, 20 Dec 2025 09:10:54 -0500 Subject: [PATCH] fix: apply backend lint --- http/http.go | 6 +++--- http/users.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/http/http.go b/http/http.go index e06d9a61..bb57f395 100644 --- a/http/http.go +++ b/http/http.go @@ -11,9 +11,9 @@ import ( ) type modifyRequest struct { - What string `json:"what"` // Answer to: what data type? - Which []string `json:"which"` // Answer to: which fields? - Current_Password string `json:"current_password"` // Answer to: user logged password + What string `json:"what"` // Answer to: what data type? + Which []string `json:"which"` // Answer to: which fields? + CurrentPassword string `json:"current_password"` // Answer to: user logged password } func NewHandler( diff --git a/http/users.go b/http/users.go index 550cb460..adae7729 100644 --- a/http/users.go +++ b/http/users.go @@ -119,7 +119,7 @@ var userPostHandler = withAdmin(func(w http.ResponseWriter, r *http.Request, d * } if d.settings.AuthMethod == auth.MethodJSONAuth { - if !users.CheckPwd(req.modifyRequest.Current_Password, d.user.Password) { + if !users.CheckPwd(req.CurrentPassword, d.user.Password) { return http.StatusBadRequest, fberrors.ErrCurrentPasswordIncorrect } } @@ -171,9 +171,9 @@ var userPutHandler = withSelfOrAdmin(func(w http.ResponseWriter, r *http.Request "perm": {}, } - for _, field := range req.modifyRequest.Which { + for _, field := range req.Which { if _, ok := sensibleFields[field]; ok { - if !users.CheckPwd(req.modifyRequest.Current_Password, d.user.Password) { + if !users.CheckPwd(req.CurrentPassword, d.user.Password) { return http.StatusBadRequest, fberrors.ErrCurrentPasswordIncorrect } break