BF auth state

This commit is contained in:
a6a2f5842 2025-10-15 10:32:35 +02:00
parent 5eba7e19ff
commit f5df27f96a
1 changed files with 8 additions and 6 deletions

View File

@ -134,7 +134,7 @@ class Handler implements MessageComponentInterface
])); ]));
} }
$this->authenticateConnection($connection, $channel); $this->authenticateConnection($connection, $channel, $message);
\Log::channel('websocket')->info('[' . $connection->socketId . ']@' . $channel->getName() . ' | ' . json_encode($message)); \Log::channel('websocket')->info('[' . $connection->socketId . ']@' . $channel->getName() . ' | ' . json_encode($message));
@ -478,13 +478,15 @@ class Handler implements MessageComponentInterface
$message = [] $message = []
) { ) {
if (! optional($connection)->auth && $connection->socketId && cache()->get('socket_' . $connection->socketId)) { if (
!optional($connection)->auth
$cached_auth = cache()->get('socket_' . $connection->socketId); && $connection->socketId
&& ($cached_auth = cache()->get('socket_' . $connection->socketId))
&& @$cached_auth['type']
) {
$connection->user = @$cached_auth['type']::find($cached_auth['id']); $connection->user = @$cached_auth['type']::find($cached_auth['id']);
if($channel){ if ($channel) {
$channel->saveConnection($connection); $channel->saveConnection($connection);
} }
} }