diff --git a/CHANGES.md b/CHANGES.md index 7c0ac1063..6c7db6743 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,5 @@ +- Fix invited account verified status [#4776](https://github.com/appwrite/appwrite/pull/4776) + # Version 1.1.2 ## Changes - Released `appwrite/console` [2.0.2](https://github.com/appwrite/console/releases/tag/2.0.2) diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index dd214f562..567560c6a 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -724,7 +724,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') ->setAttribute('confirm', true) ; - $user->setAttribute('emailVerification', true); + $user = Authorization::skip(fn() => $dbForProject->updateDocument('users', $user->getId(), $user->setAttribute('emailVerification', true))); // Log user in diff --git a/tests/e2e/Services/Teams/TeamsBaseClient.php b/tests/e2e/Services/Teams/TeamsBaseClient.php index c5ecf9f7f..788626b10 100644 --- a/tests/e2e/Services/Teams/TeamsBaseClient.php +++ b/tests/e2e/Services/Teams/TeamsBaseClient.php @@ -342,6 +342,15 @@ trait TeamsBaseClient $session = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_' . $this->getProject()['$id']]; $data['session'] = $session; + $response = $this->client->call(Client::METHOD_GET, '/account', array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ])); + + $this->assertEquals(true, $response['body']['emailVerification']); + /** [START] TESTS TO CHECK PASSWORD UPDATE OF NEW USER CREATED USING TEAM INVITE */ /**