mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
(diag): remove realtime-auth-diag logging (root cause fixed in cloud)
This commit is contained in:
+5
-21
@@ -939,27 +939,11 @@ $server->onMessage(function (int $connection, string $message) use ($server, $re
|
||||
$proofForToken = new Token();
|
||||
$proofForToken->setHash(new Sha());
|
||||
|
||||
$sessionSecret = $store->getProperty('secret', '');
|
||||
$userFound = !empty($user->getId());
|
||||
$sessionsInDoc = $userFound ? \count($user->getAttribute('sessions', [])) : 0;
|
||||
$sessionVerified = $userFound && $user->sessionVerify($sessionSecret, $proofForToken);
|
||||
|
||||
if (!$userFound || !$sessionVerified) {
|
||||
$dbAdapter = $database->getAdapter();
|
||||
Console::warning(sprintf(
|
||||
'[realtime-auth-diag] project=%s userId=%s userFound=%s sessions=%d secretPrefix=%s verified=%s db=%s ns=%s tenant=%s shared=%s host=%s',
|
||||
$projectId ?? '(null)',
|
||||
$userId,
|
||||
$userFound ? 'yes' : 'no',
|
||||
$sessionsInDoc,
|
||||
\substr($sessionSecret, 0, 8),
|
||||
$sessionVerified ? 'yes' : 'no',
|
||||
$database->getDatabase(),
|
||||
$database->getNamespace(),
|
||||
$database->getTenant() ?? 'null',
|
||||
$database->getSharedTables() ? 'yes' : 'no',
|
||||
\method_exists($dbAdapter, 'getHostname') ? $dbAdapter->getHostname() : '?'
|
||||
));
|
||||
if (
|
||||
empty($user->getId()) // Check a document has been found in the DB
|
||||
|| !$user->sessionVerify($store->getProperty('secret', ''), $proofForToken) // Validate user has valid login token
|
||||
) {
|
||||
// cookie not valid
|
||||
throw new Exception(Exception::REALTIME_MESSAGE_FORMAT_INVALID, 'Session is not valid.');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user