diff --git a/app/realtime.php b/app/realtime.php index 20e6a6096e..6dfcb459d9 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -645,8 +645,10 @@ $server->onMessage(function (int $connection, string $message) use ($server, $re $database = getConsoleDB(); if ($projectId !== 'console') { - $project = $database->getAuthorization()->skip(fn () => $database->getDocument('projects', $projectId)); - $database = getProjectDB($project, $database->getAuthorization()); + $authorization = $database->getAuthorization(); + $project = $authorization->skip(fn () => $database->getDocument('projects', $projectId)); + $database = getProjectDB($project); + $database->setAuthorization($authorization); } else { $project = null; } @@ -656,7 +658,7 @@ $server->onMessage(function (int $connection, string $message) use ($server, $re * * Abuse limits are sending 32 times per minute and connection. */ - $timeLimit = getTimelimit('url:{url},connection:{connection}', 32, 60); + $timeLimit = new TimeLimitRedis('url:{url},connection:{connection}', 32, 60, getRedis()); $timeLimit ->setParam('{connection}', $connection) diff --git a/composer.lock b/composer.lock index a453dd8b56..b3678d693e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "46333fff6a2fce6d593be22b32cdf282", + "content-hash": "1167f8ad5c99b75e2c76109ccd1e5772", "packages": [ { "name": "adhocore/jwt",