1
0
Fork 0
mirror of synced 2024-06-03 03:14:50 +12:00

Merge pull request #1408 from appwrite/fix-jwt-validate-attribute

fix(jwt): correct session validation
This commit is contained in:
Eldad A. Fux 2021-07-19 21:23:04 +03:00 committed by GitHub
commit f388c44e20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -467,7 +467,7 @@ App::setResource('user', function($mode, $project, $console, $request, $response
$user = $projectDB->getDocument($jwtUserId);
}
if (empty($user->search('$id', $jwtSessionId, $user->getAttribute('tokens')))) { // Match JWT to active token
if (empty($user->search('$id', $jwtSessionId, $user->getAttribute('sessions')))) { // Match JWT to active token
$user = new Document(['$id' => '', '$collection' => Database::SYSTEM_COLLECTION_USERS]);
}
}