Refactor: Update database authorization handling in realtime.php and regenerate composer.lock

This commit is contained in:
shimon
2025-11-28 16:22:59 +02:00
parent 5b3659af7c
commit b899e13763
2 changed files with 6 additions and 4 deletions
+5 -3
View File
@@ -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)
Generated
+1 -1
View File
@@ -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",