From efe093ce3c7fbac574d58414a487df40714b6959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 24 Nov 2022 12:35:26 +0100 Subject: [PATCH 1/4] Fix unsaved changes in team inv --- app/controllers/api/teams.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index dd214f562..eb020202b 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 = $dbForProject->updateDocument('users', $user->getId(), $user->setAttribute('emailVerification', true)); // Log user in From 5e872f2fe57a0f1b8ade1028a74cfb2c8bb7cc82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 24 Nov 2022 12:36:14 +0100 Subject: [PATCH 2/4] Update changelog --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 54f305700..086b28b5b 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 - Make `region` parameter optional with default for project create [#4763](https://github.com/appwrite/appwrite/pull/4763) From 0cb2ed14f444bc319d081d8350db0b2312e3f283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 24 Nov 2022 12:40:17 +0100 Subject: [PATCH 3/4] Improve tests --- tests/e2e/Services/Teams/TeamsBaseClient.php | 9 +++++++++ 1 file changed, 9 insertions(+) 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 */ /** From 8b71e318c2c402da010e85a612461cadaf7df1a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 24 Nov 2022 11:55:49 +0000 Subject: [PATCH 4/4] Fix tests bug --- app/controllers/api/teams.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index eb020202b..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 = $dbForProject->updateDocument('users', $user->getId(), $user->setAttribute('emailVerification', true)); + $user = Authorization::skip(fn() => $dbForProject->updateDocument('users', $user->getId(), $user->setAttribute('emailVerification', true))); // Log user in