Display Lockout Error to User (#11135)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
03e5525fa6
Коммит
f49a0881bf
@@ -4220,13 +4220,13 @@ func TestLoginLockout(t *testing.T) {
|
||||
_, resp = th.Client.Login(th.BasicUser.Email, "wrong")
|
||||
CheckErrorMessage(t, resp, "api.user.login.invalid_credentials_email_username")
|
||||
_, resp = th.Client.Login(th.BasicUser.Email, "wrong")
|
||||
CheckErrorMessage(t, resp, "api.user.login.invalid_credentials_email_username")
|
||||
CheckErrorMessage(t, resp, "api.user.check_user_login_attempts.too_many.app_error")
|
||||
_, resp = th.Client.Login(th.BasicUser.Email, "wrong")
|
||||
CheckErrorMessage(t, resp, "api.user.login.invalid_credentials_email_username")
|
||||
CheckErrorMessage(t, resp, "api.user.check_user_login_attempts.too_many.app_error")
|
||||
|
||||
//Check if lock is active
|
||||
_, resp = th.Client.Login(th.BasicUser.Email, th.BasicUser.Password)
|
||||
CheckErrorMessage(t, resp, "api.user.login.invalid_credentials_email_username")
|
||||
CheckErrorMessage(t, resp, "api.user.check_user_login_attempts.too_many.app_error")
|
||||
|
||||
// Fake user has MFA enabled
|
||||
if result := <-th.Server.Store.User().UpdateMfaActive(th.BasicUser2.Id, true); result.Err != nil {
|
||||
@@ -4239,9 +4239,9 @@ func TestLoginLockout(t *testing.T) {
|
||||
_, resp = th.Client.LoginWithMFA(th.BasicUser2.Email, th.BasicUser2.Password, "000000")
|
||||
CheckErrorMessage(t, resp, "api.user.check_user_mfa.bad_code.app_error")
|
||||
_, resp = th.Client.LoginWithMFA(th.BasicUser2.Email, th.BasicUser2.Password, "000000")
|
||||
CheckErrorMessage(t, resp, "api.user.login.invalid_credentials_email_username")
|
||||
CheckErrorMessage(t, resp, "api.user.check_user_login_attempts.too_many.app_error")
|
||||
_, resp = th.Client.LoginWithMFA(th.BasicUser2.Email, th.BasicUser2.Password, "000000")
|
||||
CheckErrorMessage(t, resp, "api.user.login.invalid_credentials_email_username")
|
||||
CheckErrorMessage(t, resp, "api.user.check_user_login_attempts.too_many.app_error")
|
||||
|
||||
// Fake user has MFA disabled
|
||||
if result := <-th.Server.Store.User().UpdateMfaActive(th.BasicUser2.Id, false); result.Err != nil {
|
||||
@@ -4250,5 +4250,5 @@ func TestLoginLockout(t *testing.T) {
|
||||
|
||||
//Check if lock is active
|
||||
_, resp = th.Client.Login(th.BasicUser2.Email, th.BasicUser2.Password)
|
||||
CheckErrorMessage(t, resp, "api.user.login.invalid_credentials_email_username")
|
||||
CheckErrorMessage(t, resp, "api.user.check_user_login_attempts.too_many.app_error")
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user