diff --git a/models/user.go b/models/user.go index 03fa471..bc35ae6 100644 --- a/models/user.go +++ b/models/user.go @@ -9,6 +9,8 @@ type User struct { Password []byte } +// UserNoPassword contains the non password user fields. +// This is preferred outside of the model / store. type UserNoPassword struct { UserID int64 `json:"user_id"` Username string `json:"username"` @@ -24,6 +26,7 @@ func (m *Model) User(id int) (*UserNoPassword, error) { return user.NoPassword(), wrapNotFound(err) } +// NoPassword strips the user of password. func (u *User) NoPassword() *UserNoPassword { return &UserNoPassword{ UserID: u.UserID,