diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index c39ed8755f..789fce6d71 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -3932,6 +3932,8 @@ Http::put('/v1/account/recovery') $hooks->trigger('passwordValidator', [$dbForProject, $project, $password, &$user, true]); + $sessions = $profile->getAttribute('sessions', []); + $profile = $dbForProject->updateDocument('users', $profile->getId(), new Document( [ 'password' => $newPassword, @@ -3946,7 +3948,7 @@ Http::put('/v1/account/recovery') $invalidate = $project->getAttribute('auths', default: [])['invalidateSessions'] ?? false; if ($invalidate) { - foreach ($profile->getAttribute('sessions', []) as $session) { + foreach ($sessions as $session) { /** @var Document $session */ $dbForProject->deleteDocument('sessions', $session->getId()); } diff --git a/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Get.php b/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Get.php index b749bba901..0a856bb5a8 100644 --- a/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Get.php +++ b/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Get.php @@ -71,7 +71,7 @@ class Get extends Action } if ($membership->getAttribute('teamInternalId') !== $team->getSequence()) { - throw new Exception(Exception::MEMBERSHIP_NOT_FOUND); + throw new Exception(Exception::TEAM_MEMBERSHIP_MISMATCH); } // Default should be "false", but existing projects already rely on this being "true" diff --git a/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Update.php b/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Update.php index bdba04ed57..0d2f1e40b4 100644 --- a/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Update.php +++ b/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Update.php @@ -79,7 +79,7 @@ class Update extends Action } if ($membership->getAttribute('teamInternalId') !== $team->getSequence()) { - throw new Exception(Exception::MEMBERSHIP_NOT_FOUND); + throw new Exception(Exception::TEAM_MEMBERSHIP_MISMATCH); } $profile = $dbForProject->getDocument('users', $membership->getAttribute('userId'));