webadmin: add defender page

This commit is contained in:
Nicola Murino
2021-06-08 13:24:28 +02:00
parent feec2118bb
commit 4be6307d87
15 changed files with 322 additions and 57 deletions

View File

@@ -66,7 +66,7 @@ type Admin struct {
}
func (a *Admin) checkPassword() error {
if a.Password != "" && !strings.HasPrefix(a.Password, argonPwdPrefix) {
if a.Password != "" && !utils.IsStringPrefixInSlice(a.Password, internalHashPwdPrefixes) {
if config.PasswordHashing.Algo == HashingAlgoBcrypt {
pwd, err := bcrypt.GenerateFromPassword([]byte(a.Password), config.PasswordHashing.BcryptOptions.Cost)
if err != nil {