mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 00:49:02 +00:00
sync with main
This commit is contained in:
parent
e019e426f1
commit
b3db296f13
1 changed files with 10 additions and 0 deletions
|
|
@ -285,6 +285,16 @@ App::setResource('project', function ($dbForPlatform, $request, $console) {
|
|||
|
||||
$project = Authorization::skip(fn () => $dbForPlatform->getDocument('projects', $projectId));
|
||||
|
||||
if (!empty($project->getAttribute('region')) && $project->getAttribute('region') !== System::getEnv('_APP_REGION', 'default')) {
|
||||
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');
|
||||
}
|
||||
|
||||
return $project;
|
||||
}, ['dbForPlatform', 'request', 'console']);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue