feat: fix login with password bug when feature is disabled (#1428)

This commit is contained in:
June
2022-12-27 13:46:57 +07:00
committed by GitHub
parent 86ae97d1e5
commit c952c2f2f4
9 changed files with 12 additions and 0 deletions

View File

@ -265,6 +265,10 @@ func (c *ApiController) Login() {
c.ResponseError(fmt.Sprintf(c.T("auth:The application: %s does not exist"), form.Application))
return
}
if !application.EnablePassword {
c.ResponseError(c.T("auth:The login method: login with password is not enabled for the application"))
return
}
if object.CheckToEnableCaptcha(application) {
isHuman, err := captcha.VerifyCaptchaByCaptchaType(form.CaptchaType, form.CaptchaToken, form.ClientSecret)