improve login error handling
This commit is contained in:
@@ -12,9 +12,9 @@ use common\models\Customer;
|
||||
use customerapi\models\LoginForm;
|
||||
use customerapi\models\PasswordChangeForm;
|
||||
use sizeg\jwt\Jwt;
|
||||
use sizeg\jwt\JwtHttpBearerAuth;
|
||||
use Yii;
|
||||
use yii\web\BadRequestHttpException;
|
||||
use yii\web\UnauthorizedHttpException;
|
||||
|
||||
/** @noinspection PhpUnused */
|
||||
|
||||
@@ -59,11 +59,7 @@ class UserController extends RestController
|
||||
'token' => (string)$token,
|
||||
]);
|
||||
} else {
|
||||
return $this->asJson(
|
||||
[
|
||||
'errors' => $form->getErrors()
|
||||
]
|
||||
);
|
||||
throw new UnauthorizedHttpException("Hibás e-mail cím vagy jelszó!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user