From b9acae5a255f6f276c43ea9dc4037cde46317662 Mon Sep 17 00:00:00 2001 From: shimon Date: Tue, 21 Jan 2025 09:43:34 +0200 Subject: [PATCH] debug --- app/init.php | 11 ----------- src/Appwrite/Auth/Auth.php | 12 ------------ 2 files changed, 23 deletions(-) diff --git a/app/init.php b/app/init.php index 14e614bf1e..2c827779d5 100644 --- a/app/init.php +++ b/app/init.php @@ -608,15 +608,6 @@ Database::addFilter( $value = json_decode($value, true); $key = System::getEnv('_APP_OPENSSL_KEY_V' . $value['version']); - var_dump([ - 'region' => System::getEnv('_APP_REGION', 'default'), - 'key' => $key, - 'value' => $value, - 'method' => $value['method'], - 'data' => $value['data'], - 'iv' => hex2bin($value['iv']), - 'tag' => hex2bin($value['tag']) - ]); return OpenSSL::decrypt($value['data'], $value['method'], $key, 0, hex2bin($value['iv']), hex2bin($value['tag'])); } ); @@ -1311,7 +1302,6 @@ App::setResource('user', function ($mode, $project, $console, $request, $respons $user = $dbForPlatform->getDocument('users', Auth::$unique); } - if ( $user->isEmpty() // Check a document has been found in the DB || !Auth::sessionVerify($user->getAttribute('sessions', []), Auth::$secret) @@ -1319,7 +1309,6 @@ App::setResource('user', function ($mode, $project, $console, $request, $respons $user = new Document([]); } - // if (APP_MODE_ADMIN === $mode) { // if ($user->find('teamInternalId', $project->getAttribute('teamInternalId'), 'memberships')) { // Authorization::setDefaultStatus(false); // Cancel security segmentation for admin users. diff --git a/src/Appwrite/Auth/Auth.php b/src/Appwrite/Auth/Auth.php index 4b1cb5f07a..1e8109622e 100644 --- a/src/Appwrite/Auth/Auth.php +++ b/src/Appwrite/Auth/Auth.php @@ -385,19 +385,7 @@ class Auth */ public static function sessionVerify(array $sessions, string $secret) { - - - foreach ($sessions as $session) { - - var_dump([ - 'secret from cookie' => $secret, - 'hashed secret' => self::hash($secret), - 'secret from db' => $session->getAttribute('secret'), - 'secret_validation' => $session->getAttribute('secret') === self::hash($secret), - ]); - - if ( $session->isSet('secret') && $session->isSet('provider') &&