feat: Reduce password strength requirements (#1224)

This commit is contained in:
jeessy2 2024-08-18 19:46:33 -07:00 committed by GitHub
parent 3257d0776b
commit 771e180aa3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -205,9 +205,9 @@ func (conf *Config) ResetPassword(newPassword string) {
// CheckPassword 检查密码 // CheckPassword 检查密码
func (conf *Config) CheckPassword(newPassword string) (hashedPwd string, err error) { func (conf *Config) CheckPassword(newPassword string) (hashedPwd string, err error) {
var minEntropyBits float64 = 50 var minEntropyBits float64 = 30
if conf.NotAllowWanAccess { if conf.NotAllowWanAccess {
minEntropyBits = 25 minEntropyBits = 20
} }
err = passwordvalidator.Validate(newPassword, minEntropyBits) err = passwordvalidator.Validate(newPassword, minEntropyBits)
if err != nil { if err != nil {

View File

@ -158,7 +158,7 @@ func loginUnlock() (minute uint32) {
go func(ticker *time.Ticker) { go func(ticker *time.Ticker) {
for range ticker.C { for range ticker.C {
ld.failedTimes = 0 ld.failedTimes = 4
ticker.Stop() ticker.Stop()
} }
}(ld.ticker) }(ld.ticker)