mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
Post connection info and user to endpoint
This commit is contained in:
@@ -66,6 +66,7 @@ class ControlConnection
|
|||||||
return [
|
return [
|
||||||
'type' => 'http',
|
'type' => 'http',
|
||||||
'host' => $this->host,
|
'host' => $this->host,
|
||||||
|
'remote_address' => $this->socket->remoteAddress,
|
||||||
'server_host' => $this->serverHost,
|
'server_host' => $this->serverHost,
|
||||||
'client_id' => $this->client_id,
|
'client_id' => $this->client_id,
|
||||||
'client_version' => $this->client_version,
|
'client_version' => $this->client_version,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Server\Support;
|
namespace App\Server\Support;
|
||||||
|
|
||||||
|
use App\Server\Connections\ControlConnection;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Clue\React\Buzz\Browser;
|
use Clue\React\Buzz\Browser;
|
||||||
@@ -21,12 +22,16 @@ class RetrieveWelcomeMessageFromApi
|
|||||||
$this->url = config('expose.admin.welcome_message_api_url');
|
$this->url = config('expose.admin.welcome_message_api_url');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function forUser($user)
|
public function forUser(ControlConnection $connectionInfo, $user)
|
||||||
{
|
{
|
||||||
return $this->browser
|
return $this->browser
|
||||||
->get($this->url . '?' . http_build_query($user), [
|
->post($this->url, [
|
||||||
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json',
|
'Accept' => 'application/json',
|
||||||
])
|
], json_encode([
|
||||||
|
'user' => $user,
|
||||||
|
'connectionInfo' => $connectionInfo->toArray(),
|
||||||
|
]))
|
||||||
->then(function (ResponseInterface $response) {
|
->then(function (ResponseInterface $response) {
|
||||||
$result = json_decode($response->getBody());
|
$result = json_decode($response->getBody());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user