mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-05-05 12:22:35 +02:00
Fix username changing only on frontend
This commit is contained in:
parent
d7f35991df
commit
1873db9006
2 changed files with 4 additions and 0 deletions
|
@ -58,10 +58,13 @@ func (db *appdbimpl) CreateUser(name string) (string, error) {
|
|||
return "", errors.New("username already exists")
|
||||
}
|
||||
|
||||
// create new user id
|
||||
uid, err := uuid.NewV4()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
// insert the new user into the database
|
||||
_, err = db.c.Exec(`INSERT INTO "users" ("uid", "name") VALUES (?, ?)`, uid.String(), name)
|
||||
return uid.String(), err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue