X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FMagic.php;h=c300e5971e4bddd4f0d550d443d906ec78c47f7d;hb=40777d08c198ed5f435a7b029e25ea139de62c16;hp=c861d3054b73e1f68f520171447e8be40210bb14;hpb=5aad46c7fb2b66d63ad93d92ee355fc522b57be1;p=friendica.git diff --git a/src/Module/Magic.php b/src/Module/Magic.php index c861d3054b..c300e5971e 100644 --- a/src/Module/Magic.php +++ b/src/Module/Magic.php @@ -1,6 +1,6 @@ app = $app; - $this->dba = $dba; - $this->httpClient = $httpClient; + $this->app = $app; + $this->dba = $dba; + $this->httpClient = $httpClient; + $this->userSession = $userSession; } protected function rawContent(array $request = []) @@ -89,8 +94,8 @@ class Magic extends BaseModule } // OpenWebAuth - if (local_user() && $owa) { - $user = User::getById(local_user()); + if ($this->userSession->getLocalUserId() && $owa) { + $user = User::getById($this->userSession->getLocalUserId()); // Extract the basepath // NOTE: we need another solution because this does only work @@ -112,7 +117,7 @@ class Magic extends BaseModule ); // Try to get an authentication token from the other instance. - $curlResult = $this->httpClient->get($basepath . '/owa', [HttpClientOptions::HEADERS => $header]); + $curlResult = $this->httpClient->get($basepath . '/owa', HttpClientAccept::DEFAULT, [HttpClientOptions::HEADERS => $header]); if ($curlResult->isSuccess()) { $j = json_decode($curlResult->getBody(), true);