Добавлена передача email при входе в неактивированный аккаунт

This commit is contained in:
ErickSkrauch
2016-03-13 21:46:22 +03:00
parent 7b9119ef79
commit 6b04860f0e
3 changed files with 9 additions and 2 deletions

View File

@ -36,10 +36,16 @@ class AuthenticationController extends Controller {
$model = new LoginForm();
$model->load(Yii::$app->request->post());
if (($jwt = $model->login()) === false) {
return [
$data = [
'success' => false,
'errors' => $this->normalizeModelErrors($model->getErrors()),
];
if (ArrayHelper::getValue($data['errors'], 'login') === 'error.account_not_activated') {
$data['data']['email'] = $model->getAccount()->email;
}
return $data;
}
return [