summaryrefslogtreecommitdiffhomepage
path: root/src/dbx/users.go
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2025-06-13 22:16:32 +0200
committerThomas Voss <mail@thomasvoss.com> 2025-06-13 22:16:32 +0200
commite505d127c7033ad3a91f7b298322edd2d471816b (patch)
tree0817c794e342bada6d662c891b7aaca4d7fbc585 /src/dbx/users.go
parent4bd7375953c7553bc5f16961cf54682fa65782c1 (diff)
Add a translates field to users
Diffstat (limited to 'src/dbx/users.go')
-rw-r--r--src/dbx/users.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/dbx/users.go b/src/dbx/users.go
index d8305f8..e2270db 100644
--- a/src/dbx/users.go
+++ b/src/dbx/users.go
@@ -9,10 +9,11 @@ import (
)
type User struct {
- Email string `db:"email"`
- Username string `db:"username"`
- Password string `db:"password"`
- AdminP bool `db:"adminp"`
+ Email string `db:"email"`
+ Username string `db:"username"`
+ Password string `db:"password"`
+ AdminP bool `db:"adminp"`
+ Translates string `db:"translates"`
}
var LoginFailed = errors.New("No user with the given username and password")
@@ -31,9 +32,10 @@ func CreateUser(user User) error {
email,
username,
password,
- adminp
- ) VALUES (?, ?, ?, ?)
- `, user.Email, user.Username, string(hash), user.AdminP)
+ adminp,
+ translates
+ ) VALUES (?, ?, ?, ?, ?)
+ `, user.Email, user.Username, string(hash), user.AdminP, user.Translates)
return err
}