Refactor error check in AuthController.
Changed the error check in the AuthController from checking if the result is not successful to checking if the result has an error. This change was made to clarify the code and ensure that errors are handled properly.
This commit is contained in:
parent
6dd24ac1d3
commit
92206a028a
@ -26,7 +26,7 @@ final class AuthController extends Controller
|
|||||||
{
|
{
|
||||||
$authorization = $request->getDto();
|
$authorization = $request->getDto();
|
||||||
$result = $this->authService->authorization($authorization);
|
$result = $this->authService->authorization($authorization);
|
||||||
if (!$result->isSuccess()) {
|
if ($result->isError()) {
|
||||||
if ($result->getCode() === Response::HTTP_UNAUTHORIZED) {
|
if ($result->getCode() === Response::HTTP_UNAUTHORIZED) {
|
||||||
Log::warning('Unauthorized ' . $authorization->getEmail() . ' [' . $request->getClientIp() . ']');
|
Log::warning('Unauthorized ' . $authorization->getEmail() . ' [' . $request->getClientIp() . ']');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user