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

Added project exists check

This commit is contained in:
Eldad Fux 2021-05-17 12:37:48 +03:00
parent f2976a82ad
commit c91c5cfbac

View file

@ -85,7 +85,11 @@ App::init(function ($utopia, $request, $response, $console, $project, $consoleDB
$route = $utopia->match($request);
if (!empty($route->getLabel('sdk.auth', [])) && empty($project->getId()) && ($route->getLabel('scope', '') !== 'public')) {
if ($project->isEmpty()) {
throw new Exception('Project not found', 404);
}
if (!empty($route->getLabel('sdk.auth', [])) && $project->isEmpty() && ($route->getLabel('scope', '') !== 'public')) {
throw new Exception('Missing or unknown project ID', 400);
}