From 246c334127d3edcf5dad458e0e13892749b8e154 Mon Sep 17 00:00:00 2001 From: shimon Date: Mon, 13 Jan 2025 21:05:19 +0200 Subject: [PATCH] debug region validation --- app/init.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/init.php b/app/init.php index efe797175a..22c96ec4fc 100644 --- a/app/init.php +++ b/app/init.php @@ -1348,8 +1348,12 @@ App::setResource('project', function ($dbForPlatform, $request, $console) { $project = Authorization::skip(fn () => $dbForPlatform->getDocument('projects', $projectId)); if ($project->getAttribute('region') !== System::getEnv('_APP_REGION', 'default')) { - var_dump(System::getEnv('_APP_REGION')); - var_dump($project->getAttribute('region')); + var_dump([ + 'projectId' => $project->getId(), + 'projectRegion' => $project->getAttribute('region'), + '_APP_REGION' => System::getEnv('_APP_REGION'), + ]); + throw new Exception(Exception::GENERAL_ACCESS_FORBIDDEN, 'Project is not accessible in this region. Please make sure you are using the correct endpoint'); }