diff --git a/app/config/scopes/account.php b/app/config/scopes/account.php index 5041408b2d..7705dfca8a 100644 --- a/app/config/scopes/account.php +++ b/app/config/scopes/account.php @@ -10,6 +10,6 @@ return [ "description" => 'Access to read account\'s organizations.', ], "teams.write" => [ - "description" => 'Access to create, update and delete account\'s organizations and it\'s memberships.', + "description" => 'Access to create, update and delete account\'s organizations and its memberships.', ], ]; diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 661e99ef1b..1ec33742fb 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -437,13 +437,14 @@ App::delete('/v1/teams/:teamId') $deletes = new Deletes(); $deletes->deleteMemberships($getProjectDB, $clone, $project); + // Async delete if ($project->getId() === 'console') { $queueForDeletes ->setType(DELETE_TYPE_TEAM_PROJECTS) - ->setDocument($clone); + ->setDocument($clone) + ->trigger(); } - // Async delete $queueForDeletes ->setType(DELETE_TYPE_DOCUMENT) ->setDocument($clone); diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 58e81a4868..60d89df86b 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -330,6 +330,7 @@ App::init() // For standard keys, update last accessed time if (\in_array($apiKey->getType(), [API_KEY_STANDARD, API_KEY_ORGANIZATION, API_KEY_ACCOUNT])) { + $dbKey = null; if (!empty($apiKey->getProjectId())) { $dbKey = $project->find( key: 'secret', diff --git a/tests/unit/Auth/KeyTest.php b/tests/unit/Auth/KeyTest.php index 830ac29dd0..fc1779efad 100644 --- a/tests/unit/Auth/KeyTest.php +++ b/tests/unit/Auth/KeyTest.php @@ -41,7 +41,7 @@ class KeyTest extends TestCase $this->assertEquals(\array_merge($scopes, $roleScopes), $decoded->getScopes()); $this->assertEquals('Dynamic Key', $decoded->getName()); - // Decode dyamic key with extras + // Decode dynamic key with extras $extra = [ 'disabledMetrics' => ['metric123'], 'hostnameOverride' => true, @@ -127,7 +127,7 @@ class KeyTest extends TestCase $this->assertEquals(\array_merge($scopes, $roleScopes), $decoded->getScopes()); $this->assertEquals('Standard key', $decoded->getName()); - // Decode depricated standard key + // Decode deprecated standard key $scopes = ['custom.write']; $decoded = Key::decode( project: new Document(['$id' => $projectId, 'keys' => [