diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-23 18:30:19 +0200 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-23 18:30:19 +0200 |
commit | df3068728abacfc98fa19f3dba62b35f65aea731 (patch) | |
tree | 689aecde69e462cc3ea33caf8ec1cbaccc7bd11a /model/user.go | |
parent | baad75737135eced6f33fecc1c4104f70719c0ce (diff) |
Remove salt from bcrypt password, because it's useless
Diffstat (limited to 'model/user.go')
-rw-r--r-- | model/user.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/model/user.go b/model/user.go index 09562bd..25a2360 100644 --- a/model/user.go +++ b/model/user.go @@ -7,30 +7,29 @@ import ( type User struct { Id UUID Name string - Salt string Password []byte } func GetUserByName(db *sql.DB, name string) *User { - row := db.QueryRow("SELECT Id, Name, Salt, Password FROM User WHERE Name=$1", name) + row := db.QueryRow("SELECT Id, Name, Password FROM User WHERE Name=$1", name) if row == nil { return nil } var user User - row.Scan(&user.Id, &user.Name, &user.Salt, &user.Password) + row.Scan(&user.Id, &user.Name, &user.Password) return &user } func GetUserById(db *sql.DB, id UUID) *User { - row := db.QueryRow("SELECT Id, Name, Salt, Password FROM User WHERE Id=$1", id) + row := db.QueryRow("SELECT Id, Name, Password FROM User WHERE Id=$1", id) if row == nil { return nil } var user User - row.Scan(&user.Id, &user.Name, &user.Salt, &user.Password) + row.Scan(&user.Id, &user.Name, &user.Password) return &user } |