From 92206a028a12432ad5049a85d1be92350bccd570 Mon Sep 17 00:00:00 2001 From: Leonid Nikitin Date: Thu, 6 Jul 2023 22:32:29 +0600 Subject: [PATCH] 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. --- app/Http/Controllers/AuthController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index 1ac73c8..096f082 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -26,7 +26,7 @@ final class AuthController extends Controller { $authorization = $request->getDto(); $result = $this->authService->authorization($authorization); - if (!$result->isSuccess()) { + if ($result->isError()) { if ($result->getCode() === Response::HTTP_UNAUTHORIZED) { Log::warning('Unauthorized ' . $authorization->getEmail() . ' [' . $request->getClientIp() . ']'); }