Skip to content

Commit

Permalink
Fix for Symfony 5
Browse files Browse the repository at this point in the history
  • Loading branch information
lruozzi9 committed Oct 7, 2024
1 parent 4d336bc commit 72f6be6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/DataSyncInfrastructure/Controller/FeedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ public function __invoke(
throw $this->createNotFoundException();
}
if ($this->isTokenAuthenticationEnabled) {
$headerAccessTokenExtractor = new HeaderAccessTokenExtractor(self::AUTHORIZATION_HEADER);
$authToken = $headerAccessTokenExtractor->extractAccessToken($request);
if (class_exists(HeaderAccessTokenExtractor::class)) {
$headerAccessTokenExtractor = new HeaderAccessTokenExtractor(self::AUTHORIZATION_HEADER);
$authToken = $headerAccessTokenExtractor->extractAccessToken($request);
} else {
$authToken = str_replace('Bearer ', '', $request->headers->get(self::AUTHORIZATION_HEADER));
}
if ($authToken === null || !$this->requestValidator->isValid($channel, $localeCode, $authToken)) {
throw $this->createAccessDeniedException();
}
Expand Down

0 comments on commit 72f6be6

Please sign in to comment.