User registration now works.
This commit is contained in:
parent
eaaf309260
commit
45c541ee7c
3 changed files with 24 additions and 4 deletions
|
|
@ -46,9 +46,9 @@ func LoginUser(result *data.User, login *data.Login) (bool, error) {
|
|||
return login.Username == result.Username && pass_good == nil, nil
|
||||
}
|
||||
|
||||
func SetUserPassword(password string, user *data.User) error {
|
||||
hashed, err := bcrypt.GenerateFromPassword([]byte(password), 12)
|
||||
if err == nil { return err }
|
||||
func SetUserPassword(user *data.User) error {
|
||||
hashed, err := bcrypt.GenerateFromPassword([]byte(user.Password), 12)
|
||||
if err != nil { return err }
|
||||
|
||||
user.Password = string(hashed)
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue