improve login error handling

This commit is contained in:
Roland Schneider
2021-09-26 12:45:02 +02:00
parent 0b5ea5df09
commit 5533f7100b
3 changed files with 16 additions and 16 deletions

View File

@@ -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ó!");
}
}