Merge pull request #10654 from appwrite/fix-undefined-var

Fix: undefined variable warning
This commit is contained in:
Damodar Lohani 2025-10-16 13:40:04 +05:45 committed by GitHub
commit 2e10cd0009
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -299,6 +299,8 @@ App::setResource('user', function (string $mode, Document $project, Document $co
$store->decode(((is_array($fallback) && isset($fallback[$store->getKey()])) ? $fallback[$store->getKey()] : ''));
}
$user = new Document([]);
if (APP_MODE_ADMIN === $mode) {
$user = $dbForPlatform->getDocument('users', $store->getProperty('id', ''));
} else {
@ -316,7 +318,6 @@ App::setResource('user', function (string $mode, Document $project, Document $co
}
if (
!$user ||
$user->isEmpty() // Check a document has been found in the DB
|| !Auth::sessionVerify($user->getAttribute('sessions', []), $store->getProperty('secret', ''), $proofForToken)
) { // Validate user has valid login token