diff --git a/src/Authentication/Provider/SimpleOauthAuthenticationProvider.php b/src/Authentication/Provider/SimpleOauthAuthenticationProvider.php index c87e928..7953316 100644 --- a/src/Authentication/Provider/SimpleOauthAuthenticationProvider.php +++ b/src/Authentication/Provider/SimpleOauthAuthenticationProvider.php @@ -7,6 +7,7 @@ use Drupal\simple_oauth\Authentication\TokenAuthUser; use Drupal\simple_oauth\Server\ResourceServerInterface; use League\OAuth2\Server\Exception\OAuthServerException; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpKernel\Exception\HttpException; /** * @internal @@ -66,6 +67,8 @@ class SimpleOauthAuthenticationProvider implements SimpleOauthAuthenticationProv // Procedural code here is hard to avoid. watchdog_exception('simple_oauth', $exception); + throw new HttpException($exception->getHttpStatusCode(), $exception->getHint(), null, $exception->getHttpHeaders()); + return NULL; }