Fix 5xx error on authroization

This commit is contained in:
Matej Bačo
2025-03-09 18:51:49 +01:00
parent aabee0ac37
commit d86cf7b437
+1 -1
View File
@@ -202,7 +202,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw
$membershipExists = false;
$project = Authorization::skip(fn () => $dbForPlatform->getDocument('projects', $projectId));
if (!$project->isEmpty()) {
if (!$project->isEmpty() && isset($user)) {
$teamId = $project->getAttribute('teamId', '');
$membership = $user->find('teamId', $teamId, 'memberships');
if (!empty($membership)) {