mirror of
https://github.com/jeessy2/ddns-go.git
synced 2024-11-25 16:46:24 +08:00
feat: Reduce password strength requirements (#1224)
This commit is contained in:
parent
3257d0776b
commit
771e180aa3
@ -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 {
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user