Skip to content
Snippets Groups Projects
Commit 67d481e2 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Remove deprecated homeserver field

parent 4d152fde
No related branches found
No related tags found
No related merge requests found
......@@ -19,9 +19,6 @@ struct Login
//! An access token for the account.
//! This access token can then be used to authorize other requests.
std::string access_token;
//! The hostname of the homeserver on which the account has been registered.
[[deprecated("Clients should extract the server_name from user_id (by splitting at the "
"first colon) if they require it.")]] std::string home_server;
//! ID of the logged-in device.
//! Will be the same as the corresponding parameter in the request, if one was specified.
std::string device_id;
......
......@@ -13,9 +13,6 @@ from_json(const json &obj, Login &response)
response.access_token = obj.at("access_token").get<std::string>();
if (obj.count("home_server") != 0)
response.home_server = obj.at("home_server").get<std::string>();
if (obj.count("device_id") != 0)
response.device_id = obj.at("device_id").get<std::string>();
......
......@@ -94,7 +94,6 @@ TEST(ClientAPI, LoginWrongPassword)
EXPECT_EQ(res.user_id.to_string(), "");
EXPECT_EQ(res.device_id, "");
EXPECT_EQ(res.home_server, "");
EXPECT_EQ(res.access_token, "");
});
......@@ -112,7 +111,6 @@ TEST(ClientAPI, LoginWrongUsername)
EXPECT_EQ(res.user_id.to_string(), "");
EXPECT_EQ(res.device_id, "");
EXPECT_EQ(res.home_server, "");
EXPECT_EQ(res.access_token, "");
});
......
......@@ -508,7 +508,6 @@ TEST(Responses, Login)
Login login = data;
EXPECT_EQ(login.user_id.to_string(), "@cheeky_monkey:matrix.org");
EXPECT_EQ(login.access_token, "abc123");
EXPECT_EQ(login.home_server, "matrix.org");
EXPECT_EQ(login.device_id, "GHTYAJCE");
EXPECT_EQ(login.well_known->homeserver.base_url, "https://example.org");
EXPECT_EQ(login.well_known->identity_server->base_url, "https://id.example.org");
......@@ -522,7 +521,6 @@ TEST(Responses, Login)
Login login2 = data2;
EXPECT_EQ(login2.user_id.to_string(), "@cheeky_monkey:matrix.org");
EXPECT_EQ(login2.access_token, "abc123");
EXPECT_EQ(login2.home_server, "matrix.org");
EXPECT_EQ(login2.device_id, "");
json data3 = R"({
......@@ -532,7 +530,6 @@ TEST(Responses, Login)
Login login3 = data3;
EXPECT_EQ(login3.user_id.to_string(), "@cheeky_monkey:matrix.org");
EXPECT_EQ(login3.access_token, "abc123");
EXPECT_EQ(login3.home_server, "");
EXPECT_EQ(login3.device_id, "");
}
......
......@@ -59,7 +59,6 @@ inline void
validate_login(const std::string &user, const mtx::responses::Login &res)
{
EXPECT_EQ(res.user_id.to_string(), user);
EXPECT_EQ(res.home_server, "localhost");
ASSERT_TRUE(res.access_token.size() > 100);
ASSERT_TRUE(res.device_id.size() > 5);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment