feat: add the FailedSigninLimit and FailedSigninfrozenTime configuration options to the application (#2552)

Add configuration items to the application to limit the number of logins and the login wait time after the maximum number of errors is reached
feat: #2272

fix: fixed the issue where the token parameter could be set to a negative value
This commit is contained in:
HGZ-20
2023-12-20 22:29:53 +08:00
committed by GitHub
parent f8905ae64c
commit 5499e62d7f
30 changed files with 185 additions and 17 deletions

View File

@ -110,6 +110,14 @@ func (c *ApiController) GetApplication() {
}
}
// 0 as an initialization value, corresponding to the default configuration parameters
if application.FailedSigninLimit == 0 {
application.FailedSigninLimit = object.DefaultFailedSigninLimit
}
if application.FailedSigninfrozenTime == 0 {
application.FailedSigninfrozenTime = object.DefaultFailedSigninfrozenTime
}
c.ResponseOk(object.GetMaskedApplication(application, userId))
}