Skip to content

Commit 8b35946

Browse files
committed
Make actually compatible with Flow < 6
Fixes #25
1 parent f3d26ad commit 8b35946

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

Classes/OAuthClient.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
use Neos\Flow\Annotations as Flow;
1717
use Neos\Flow\Core\Bootstrap;
1818
use Neos\Flow\Http\HttpRequestHandlerInterface;
19+
use Neos\Flow\Http\Request;
1920
use Neos\Flow\Log\Utility\LogEnvironment;
2021
use Neos\Flow\Mvc\ActionRequest;
2122
use Neos\Flow\Mvc\Routing\Exception\MissingActionNameException;
2223
use Neos\Flow\Mvc\Routing\UriBuilder;
2324
use Neos\Flow\Persistence\Doctrine\Query;
2425
use Neos\Flow\Persistence\Exception\InvalidQueryException;
2526
use Neos\Flow\Session\SessionInterface;
26-
use Neos\Http\Factories\ServerRequestFactory;
2727
use Psr\Http\Message\RequestInterface;
2828
use Psr\Http\Message\UriInterface;
2929
use Psr\Log\LoggerInterface;
@@ -57,12 +57,6 @@ abstract class OAuthClient
5757
*/
5858
protected $bootstrap;
5959

60-
/**
61-
* @Flow\Inject
62-
* @var ServerRequestFactory
63-
*/
64-
protected $serverRequestFactory;
65-
6660
/**
6761
* @Flow\InjectConfiguration(path="http.baseUri", package="Neos.Flow")
6862
* @var string
@@ -460,12 +454,13 @@ public function renderFinishAuthorizationUri(): string
460454
{
461455
$currentRequestHandler = $this->bootstrap->getActiveRequestHandler();
462456
if ($currentRequestHandler instanceof HttpRequestHandlerInterface) {
463-
$httpRequest = $currentRequestHandler->getComponentContext()->getHttpRequest();
457+
$httpRequest = $currentRequestHandler->getHttpRequest();
464458
} else {
465459
putenv('FLOW_REWRITEURLS=1');
466-
$httpRequest = $this->serverRequestFactory->createServerRequest('GET', new Uri($this->flowBaseUriSetting));
460+
$httpRequest = Request::createFromEnvironment();
461+
$httpRequest->setBaseUri(new Uri($this->flowBaseUriSetting));
467462
}
468-
$actionRequest = ActionRequest::fromHttpRequest($httpRequest);
463+
$actionRequest = new ActionRequest($httpRequest);
469464

470465
$this->uriBuilder->reset();
471466
$this->uriBuilder->setRequest($actionRequest);

0 commit comments

Comments
 (0)