feat(webui): add password reset page
All checks were successful
main / main (push) Successful in 1m49s
main / deploy (push) Has been skipped
main / publish (push) Has been skipped

#20
This commit is contained in:
Julien Dessaux 2025-04-20 15:33:07 +02:00
parent bb11b870d6
commit 922112e181
Signed by: adyxax
GPG key ID: F92E51B86E07177E
7 changed files with 181 additions and 3 deletions

View file

@ -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
}