1
0
Fork 0
mirror of synced 2024-06-13 00:04:47 +12:00

Fix tests

This commit is contained in:
Matej Bačo 2022-04-27 14:11:12 +00:00
parent 50082c3512
commit 2c93cf664b
2 changed files with 4 additions and 2 deletions

View file

@ -831,6 +831,8 @@ App::put('/v1/account/sessions/magic-url')
$dbForProject->deleteDocument('tokens', $token);
$dbForProject->deleteCachedDocument('users', $user->getId());
$user = $dbForProject->updateDocument('users', $user->getId(), $user->setAttribute('sessions', $session, Document::SET_TYPE_APPEND));
if (false === $user) {
throw new Exception('Failed saving user to DB', 500, Exception::GENERAL_SERVER_ERROR);
}

View file

@ -306,10 +306,10 @@ Database::addFilter('subQueryTokens',
return null;
},
function($value, Document $document, Database $database) {
return $database
return Authorization::skip(fn() => $database
->find('tokens', [
new Query('userId', Query::TYPE_EQUAL, [$document->getId()])
], $database->getIndexLimit(), 0, []);
], $database->getIndexLimit(), 0, []));
}
);