diff options
Diffstat (limited to 'db/user.go')
-rw-r--r-- | db/user.go | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -11,10 +11,16 @@ const ( | |||
11 | AwaitingConfirmation | 11 | AwaitingConfirmation |
12 | ) | 12 | ) |
13 | 13 | ||
14 | type UserRole string | ||
15 | |||
16 | const RoleUser UserRole = "user" | ||
17 | const RoleAdmin UserRole = "admin" | ||
18 | |||
14 | type User struct { | 19 | type User struct { |
15 | Id int64 | 20 | Id int64 |
16 | Email string `sql:",unique,notnull"` | 21 | Role UserRole |
17 | PasswordHash string `sql:",notnull"` | 22 | Email string |
23 | PasswordHash string | ||
18 | OtpSecret string | 24 | OtpSecret string |
19 | IsOtpSetup bool | 25 | IsOtpSetup bool |
20 | Status UserStatus | 26 | Status UserStatus |