mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
fix(autobrrctl): prevent empty password (#1468)
* fix(autobrrctl): prevent empty password * fix(autobrrctl): prevent empty password for create-user aswell fix(autobrrctl): stringify password in checks * feat(autobrrctl): validate password length --------- Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
parent
65b42f517d
commit
2337ee4d75
2 changed files with 17 additions and 13 deletions
|
@ -154,5 +154,9 @@ func (s *service) ComparePasswordAndHash(password string, hash string) (match bo
|
|||
}
|
||||
|
||||
func (s *service) CreateHash(password string) (hash string, err error) {
|
||||
if password == "" {
|
||||
return "", errors.New("must supply non empty password to CreateHash")
|
||||
}
|
||||
|
||||
return argon2id.CreateHash(password, argon2id.DefaultParams)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue