Merge pull request #446 from TonisOrmisson/use-login-ajax-events
fixed issue: user login events not triggered on ajax requests
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
## work in progress
|
## work in progress
|
||||||
|
- Fix user login events not triggered on ajax requests (TonisOrmisson)
|
||||||
- Enh: Added minimum requirements when a new password is automatically generated (MatteoF96)
|
- Enh: Added minimum requirements when a new password is automatically generated (MatteoF96)
|
||||||
- Fix #380: Avoid rewriting AccessRule::matchRole (maxxer)
|
- Fix #380: Avoid rewriting AccessRule::matchRole (maxxer)
|
||||||
- Fix #378: Add module attribute 'disableIpLogging' (jkmssoft)
|
- Fix #378: Add module attribute 'disableIpLogging' (jkmssoft)
|
||||||
|
|||||||
@ -125,7 +125,14 @@ class SecurityController extends Controller
|
|||||||
if (Yii::$app->request->isAjax && $form->load(Yii::$app->request->post())) {
|
if (Yii::$app->request->isAjax && $form->load(Yii::$app->request->post())) {
|
||||||
Yii::$app->response->format = Response::FORMAT_JSON;
|
Yii::$app->response->format = Response::FORMAT_JSON;
|
||||||
|
|
||||||
return ActiveForm::validate($form);
|
$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);
|
||||||
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($form->load(Yii::$app->request->post())) {
|
if ($form->load(Yii::$app->request->post())) {
|
||||||
|
|||||||
Reference in New Issue
Block a user