Commit ae490d56 authored by sleitner's avatar sleitner
Browse files

Issue #3287019 by Project Update Bot: Automated Drupal 10 compatibility fixes

parent 6a5e777b
Loading
Loading
Loading
Loading
+4 −3
Changes for src/Authentication/Provider/DoccheckIpAuth.php: 4 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -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;
@@ -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;