userRepository->getUserByEmail($authorization->getEmail()); if (is_null($user)) { return $this->errUnauthorized(__('auth.failed')); } if (Hash::check($authorization->getPassword(), $user->password) !== true) { return $this->errUnauthorized(__('auth.password')); } if ($user->is_active === false) { return $this->errFobidden(__('auth.disabled')); } try { Auth::login($user, $authorization->getRemember()); } catch (\Throwable $e) { report($e); return $this->errService(__('Server Error')); } return $this->ok(__('auth.success')); } }