Skip to content

Commit 4163fa6

Browse files
committed
Fix incorrect error messages when renaming users
1 parent c0c8e3b commit 4163fa6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

endpoints_auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func accountsEndpointPatch(connector *Connector, w http.ResponseWriter, r *http.
242242
if username == "" { // Legacy compat with older API, assume body.Username, fix in 2.0
243243
username = body.Username
244244
}
245-
toUpdateUsername := body.Username != username && body.Username != ""
245+
toUpdateUsername := r.URL.Query().Get("username") != "" && body.Username != ""
246246
if err != nil {
247247
httpError(w, "Invalid JSON body!", http.StatusBadRequest)
248248
return false

0 commit comments

Comments
 (0)