This commit is contained in:
shimon 2025-01-21 09:43:34 +02:00
parent d0452e5d3b
commit b9acae5a25
2 changed files with 0 additions and 23 deletions

View file

@ -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.

View file

@ -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') &&