Don't display password when calling api/users API.

This change fixes github issue 6838

Signed-off-by: Steven Ren <stevenr@stevenr-a01.vmware.com>
This commit is contained in:
Steven Ren 2019-05-07 18:31:50 +08:00
parent 78aea0920d
commit 8311ff729a

View File

@ -203,7 +203,10 @@ func (ua *UserAPI) List() {
ua.SendInternalServerError(fmt.Errorf("failed to get users: %v", err))
return
}
for i := range users {
user := &users[i]
user.Password = ""
}
ua.SetPaginationHeader(total, page, size)
ua.Data["json"] = users
ua.ServeJSON()