Commit 48242562 authored by Avris's avatar Avris

fix cookie issue

parent 23747c2c
......@@ -45,13 +45,14 @@ class SocketClient
$this->client->setHost($headers->has('host') ? (string) $headers->get('host') : 'localhost');
$this->client->connect();
} catch (\Exception $e) {
$this->client = null;
$notify->handle($e);
}
$this->em = $em;
}
protected function buildToken(Crypt $crypt, User $user = null, $secret = null)
private function buildToken(Crypt $crypt, User $user = null, $secret = null)
{
if (!$user) {
return $crypt->encrypt($secret);
......@@ -69,6 +70,10 @@ class SocketClient
public function onUpdateServer(UpdateServerEvent $event)
{
if (!$this->client) {
return;
}
$server = $event->getServer();
$this->client->send(json_encode([
......@@ -81,6 +86,10 @@ class SocketClient
public function onUpdateProject(UpdateProjectEvent $event)
{
if (!$this->client) {
return;
}
$project = $event->getProject();
$this->client->send(json_encode([
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment