I auth tracking
This commit is contained in:
parent
5bd6cf2341
commit
4b7c09534a
|
|
@ -9,6 +9,7 @@ use BlaxSoftware\LaravelWebSockets\Server\Loggers\ConnectionLogger;
|
||||||
use BlaxSoftware\LaravelWebSockets\Server\Loggers\HttpLogger;
|
use BlaxSoftware\LaravelWebSockets\Server\Loggers\HttpLogger;
|
||||||
use BlaxSoftware\LaravelWebSockets\Server\Loggers\WebSocketsLogger;
|
use BlaxSoftware\LaravelWebSockets\Server\Loggers\WebSocketsLogger;
|
||||||
use BlaxSoftware\LaravelWebSockets\ServerFactory;
|
use BlaxSoftware\LaravelWebSockets\ServerFactory;
|
||||||
|
use BlaxSoftware\LaravelWebSockets\Services\WebsocketService;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
use React\EventLoop\Factory as LoopFactory;
|
use React\EventLoop\Factory as LoopFactory;
|
||||||
|
|
@ -89,6 +90,8 @@ class StartServer extends Command
|
||||||
// Fixes redis concurrency issues
|
// Fixes redis concurrency issues
|
||||||
config(['cache.default' => $this->option('cache-driver', 'file')]);
|
config(['cache.default' => $this->option('cache-driver', 'file')]);
|
||||||
|
|
||||||
|
WebsocketService::resetAllTracking();
|
||||||
|
|
||||||
$this->laravel->singleton(LoopInterface::class, function () {
|
$this->laravel->singleton(LoopInterface::class, function () {
|
||||||
return $this->loop;
|
return $this->loop;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,19 @@ class WebsocketService
|
||||||
// );
|
// );
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAuth(string $socketId)
|
public static function resetAllTracking()
|
||||||
|
{
|
||||||
|
config(['cache.default' => 'file']);
|
||||||
|
cache()->forget('ws_active_channels');
|
||||||
|
cache()->forget('ws_socket_auth');
|
||||||
|
cache()->forget('ws_socket_auth_users');
|
||||||
|
cache()->forget('ws_channel_connections');
|
||||||
|
cache()->forget('ws_connection');
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getAuth(string $socketId)
|
||||||
{
|
{
|
||||||
config(['cache.default' => 'file']);
|
config(['cache.default' => 'file']);
|
||||||
return cache()->get('ws_socket_auth_' . $socketId);
|
return cache()->get('ws_socket_auth_' . $socketId);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue