Password to []byte

This commit is contained in:
gmemstr 2017-12-04 17:42:15 -08:00
parent 531aadef61
commit b2ee790b32

View file

@ -39,7 +39,7 @@ func Setup() {
fmt.Print("Administrator password: ")
text, err := reader.ReadString('\n')
hash, err := bcrypt.GenerateFromPassword(text, 8)
hash, err := bcrypt.GenerateFromPassword([]byte(password), 8)
_, err = db.Exec("INSERT INTO users(id,username,hash,realname,email,permissions) VALUES (0,`admin`,?,`Administrator`,`admin@localhost`,2", hash)