Loading src/Authentication/Provider/DoccheckIpAuth.php +4 −3 Changes for src/Authentication/Provider/DoccheckIpAuth.php: 4 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ use Drupal\Core\Session\AccountInterface; use Psr\Log\LoggerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Event\ExceptionEvent; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; Loading Loading @@ -131,10 +132,10 @@ class DoccheckIpAuth implements AuthenticationProviderInterface { /** * {@inheritdoc} */ public function handleException(GetResponseForExceptionEvent $event) { $exception = $event->getException(); public function handleException(ExceptionEvent $event) { $exception = $event->getThrowable(); if ($exception instanceof AccessDeniedHttpException) { $event->setException(new UnauthorizedHttpException('Invalid IP.', $exception)); $event->setThrowable(new UnauthorizedHttpException('Invalid IP.', $exception)); return TRUE; } return FALSE; Loading Loading
src/Authentication/Provider/DoccheckIpAuth.php +4 −3 Changes for src/Authentication/Provider/DoccheckIpAuth.php: 4 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ use Drupal\Core\Session\AccountInterface; use Psr\Log\LoggerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Event\ExceptionEvent; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; Loading Loading @@ -131,10 +132,10 @@ class DoccheckIpAuth implements AuthenticationProviderInterface { /** * {@inheritdoc} */ public function handleException(GetResponseForExceptionEvent $event) { $exception = $event->getException(); public function handleException(ExceptionEvent $event) { $exception = $event->getThrowable(); if ($exception instanceof AccessDeniedHttpException) { $event->setException(new UnauthorizedHttpException('Invalid IP.', $exception)); $event->setThrowable(new UnauthorizedHttpException('Invalid IP.', $exception)); return TRUE; } return FALSE; Loading