parent
bb11b870d6
commit
922112e181
7 changed files with 181 additions and 3 deletions
|
@ -27,3 +27,9 @@ func (account *Account) CheckPassword(password string) bool {
|
|||
hash := helpers.HashPassword(password, account.Salt)
|
||||
return subtle.ConstantTimeCompare(hash, account.PasswordHash) == 1
|
||||
}
|
||||
|
||||
func (account *Account) SetPassword(password string) {
|
||||
account.Salt = helpers.GenerateSalt()
|
||||
account.PasswordHash = helpers.HashPassword(password, account.Salt)
|
||||
account.PasswordReset = nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue