You've already forked focalboard
mirror of
https://github.com/mattermost/focalboard.git
synced 2025-07-15 23:54:29 +02:00
Fix nil stringer error (#788)
* fix nil stringer error * include API path with all API ERROR logs * enable "caller" field * disable colour output and min msg length for plugin * bump Logr version to v2.0.4
This commit is contained in:
@ -21,14 +21,14 @@ func (a *API) handleAdminSetPassword(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
requestBody, err := ioutil.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
a.errorResponse(w, http.StatusInternalServerError, "", err)
|
||||
a.errorResponse(w, r.URL.Path, http.StatusInternalServerError, "", err)
|
||||
return
|
||||
}
|
||||
|
||||
var requestData AdminSetPasswordData
|
||||
err = json.Unmarshal(requestBody, &requestData)
|
||||
if err != nil {
|
||||
a.errorResponse(w, http.StatusInternalServerError, "", err)
|
||||
a.errorResponse(w, r.URL.Path, http.StatusInternalServerError, "", err)
|
||||
return
|
||||
}
|
||||
|
||||
@ -37,13 +37,13 @@ func (a *API) handleAdminSetPassword(w http.ResponseWriter, r *http.Request) {
|
||||
auditRec.AddMeta("username", username)
|
||||
|
||||
if !strings.Contains(requestData.Password, "") {
|
||||
a.errorResponse(w, http.StatusBadRequest, "password is required", err)
|
||||
a.errorResponse(w, r.URL.Path, http.StatusBadRequest, "password is required", err)
|
||||
return
|
||||
}
|
||||
|
||||
err = a.app.UpdateUserPassword(username, requestData.Password)
|
||||
if err != nil {
|
||||
a.errorResponse(w, http.StatusInternalServerError, "", err)
|
||||
a.errorResponse(w, r.URL.Path, http.StatusInternalServerError, "", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user