diff --git a/app/config/errors.php b/app/config/errors.php index 2b21ff48e2..cba8dc8acc 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -112,7 +112,7 @@ return [ ], Exception::USER_BLOCKED => [ 'name' => Exception::USER_BLOCKED, - 'description' => 'The current user has been blocked. You can unblock the user from the Appwrite console.', + 'description' => 'The current user has been blocked.', 'code' => 401, ], Exception::USER_INVALID_TOKEN => [ diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 7c46e634c1..e211c123ee 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -1789,6 +1789,12 @@ App::patch('/v1/account/status') $response->addHeader('X-Fallback-Cookies', \json_encode([])); } + $protocol = $request->getProtocol(); + $response + ->addCookie(Auth::$cookieName . '_legacy', '', \time() - 3600, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, null) + ->addCookie(Auth::$cookieName, '', \time() - 3600, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, Config::getParam('cookieSamesite')) + ; + $response->dynamic($user, Response::MODEL_ACCOUNT); }); diff --git a/tests/e2e/Services/Account/AccountCustomClientTest.php b/tests/e2e/Services/Account/AccountCustomClientTest.php index ea24d06bdb..585c07ba59 100644 --- a/tests/e2e/Services/Account/AccountCustomClientTest.php +++ b/tests/e2e/Services/Account/AccountCustomClientTest.php @@ -221,6 +221,8 @@ class AccountCustomClientTest extends Scope ]); $this->assertEquals($response['headers']['status-code'], 200); + $this->assertStringContainsString('a_session_' . $this->getProject()['$id'] . '=deleted', $response['headers']['set-cookie']); + $this->assertEquals('[]', $response['headers']['x-fallback-cookies']); $response = $this->client->call(Client::METHOD_GET, '/account', array_merge([ 'origin' => 'http://localhost',