Skip to content
This repository was archived by the owner on Nov 7, 2019. It is now read-only.

Commit f11479e

Browse files
committed
users api endpoint cleanup
1 parent 1bc6170 commit f11479e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

user/user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type User struct {
3030
// password, only really used on account creation
3131
password string
3232
// user's email address
33-
Email string `json:"email" sql:"email"`
33+
Email string `json:"email,omitempty" sql:"email"`
3434
// user name field. could be first[space]last, but not strictly enforced
3535
Name string `json:"name" sql:"name"`
3636
// user-filled description of self

user_handlers.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ func ListUsersHandler(w http.ResponseWriter, r *http.Request) {
7474
ErrRes(w, err)
7575
return
7676
}
77+
// TODO - should this be here?
78+
for _, u := range res {
79+
// remove sensitive fields
80+
u.Email = ""
81+
}
82+
7783
Res(w, envelope, res)
7884
}
7985

0 commit comments

Comments
 (0)