Fixed issue: remove after/before login events from ajax LoginForm validation, only validation is done there

This commit is contained in:
tonis ormisson
2022-04-04 11:46:42 +03:00
parent 422a17d8dc
commit b78656d229

View File

@ -125,10 +125,8 @@ class SecurityController extends Controller
if (Yii::$app->request->isAjax && $form->load(Yii::$app->request->post())) {
Yii::$app->response->format = Response::FORMAT_JSON;
$this->trigger(FormEvent::EVENT_BEFORE_LOGIN, $event);
$errors = ActiveForm::validate($form);
if(empty($errors)) {
$this->trigger(FormEvent::EVENT_AFTER_LOGIN, $event);
return $errors;
}
$this->trigger(FormEvent::EVENT_FAILED_LOGIN, $event);