Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use stable forms for registration tokens #71

Merged
merged 1 commit into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/mtx/responses/register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void
from_json(const nlohmann::json &obj, Register &response);

//! Response from the `GET
//! /_matrix/client/unstable/org.matrix.msc3231/register/org.matrix.msc3231.login.registration_token/validity`
//! /_matrix/client/v1/register/m.login.registration_token/validity`
//! endpoint.
struct RegistrationTokenValidity
{
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/user_interactive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ constexpr std::string_view dummy = "m.login.dummy";
//! Authentication by accepting a set of terms like a privacy policy.
constexpr std::string_view terms = "m.login.terms"; // see MSC1692
//! Authentication using a registration token. See MSC3231.
constexpr std::string_view registration_token = "org.matrix.msc3231.login.registration_token";
constexpr std::string_view registration_token = "m.login.registration_token";
}

//! A list of auth types
Expand Down
3 changes: 1 addition & 2 deletions lib/http/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -981,8 +981,7 @@ void
Client::registration_token_validity(const std::string token,
Callback<mtx::responses::RegistrationTokenValidity> cb)
{
const auto api_path = "/client/unstable/org.matrix.msc3231/register/"
"org.matrix.msc3231.login.registration_token/validity?" +
const auto api_path = "/client/v1/register/m.login.registration_token/validity?" +
mtx::client::utils::query_params({{"token", token}});

get<mtx::responses::RegistrationTokenValidity>(
Expand Down
2 changes: 1 addition & 1 deletion tests/requests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ TEST(Requests, UserInteractiveAuth)

a.content = auth::RegistrationToken{"<token>"};
EXPECT_EQ(nlohmann::json(a), R"({
"type": "org.matrix.msc3231.login.registration_token",
"type": "m.login.registration_token",
"token": "<token>",
"session": "<session ID>"
})"_json);
Expand Down