Fix self-hosted region check default

This commit is contained in:
Jake Barnby 2024-12-12 18:54:58 +13:00
parent c9e6bfbdb3
commit 8f390a70c7
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -1334,7 +1334,7 @@ App::setResource('project', function ($dbForConsole, $request, $console) {
$project = Authorization::skip(fn () => $dbForConsole->getDocument('projects', $projectId));
if ($project->getAttribute('region') !== System::getEnv('_APP_REGION')) {
if ($project->getAttribute('region') !== System::getEnv('_APP_REGION', 'default')) {
var_dump(System::getEnv('_APP_REGION'));
var_dump($project->getAttribute('region'));
throw new Exception(Exception::GENERAL_ACCESS_FORBIDDEN, 'Project is not accessible in this region. Please make sure you are using the correct endpoint');