aboutsummaryrefslogtreecommitdiffhomepage
path: root/model/user.go
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2017-11-22 22:22:33 -0800
committerGravatar Frédéric Guillot <fred@miniflux.net>2017-11-22 22:22:33 -0800
commitcc6d272eb7719bcca02c7f36a1badbeecb153759 (patch)
tree2fd6e92dcaa19faccfc25ff67499abcc6dabbaaf /model/user.go
parent9877051f12621aa71daad520caa2847c47c746f8 (diff)
Add OAuth2 authentication
Diffstat (limited to 'model/user.go')
-rw-r--r--model/user.go22
1 files changed, 14 insertions, 8 deletions
diff --git a/model/user.go b/model/user.go
index 26bf6c9..6e13690 100644
--- a/model/user.go
+++ b/model/user.go
@@ -11,14 +11,20 @@ import (
// User represents a user in the system.
type User struct {
- ID int64 `json:"id"`
- Username string `json:"username"`
- Password string `json:"password,omitempty"`
- IsAdmin bool `json:"is_admin"`
- Theme string `json:"theme"`
- Language string `json:"language"`
- Timezone string `json:"timezone"`
- LastLoginAt *time.Time `json:"last_login_at"`
+ ID int64 `json:"id"`
+ Username string `json:"username"`
+ Password string `json:"password,omitempty"`
+ IsAdmin bool `json:"is_admin"`
+ Theme string `json:"theme"`
+ Language string `json:"language"`
+ Timezone string `json:"timezone"`
+ LastLoginAt *time.Time `json:"last_login_at"`
+ Extra map[string]string `json:"-"`
+}
+
+// NewUser returns a new User.
+func NewUser() *User {
+ return &User{Extra: make(map[string]string)}
}
func (u User) ValidateUserCreation() error {