From 34bac4d1d9789e49f7a55321fb643de114db2fff Mon Sep 17 00:00:00 2001 From: strawberry Date: Sat, 20 Jan 2024 19:02:44 -0500 Subject: [PATCH] support sending well_known client response in /login using `well_known_client` Signed-off-by: strawberry --- src/api/client_server/session.rs | 43 ++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/src/api/client_server/session.rs b/src/api/client_server/session.rs index f028cf93..f3dc91fe 100644 --- a/src/api/client_server/session.rs +++ b/src/api/client_server/session.rs @@ -4,7 +4,14 @@ use argon2::{PasswordHash, PasswordVerifier}; use ruma::{ api::client::{ error::ErrorKind, - session::{get_login_types, login, logout, logout_all}, + session::{ + get_login_types, + login::{ + self, + v3::{DiscoveryInfo, HomeserverInfo}, + }, + logout, logout_all, + }, uiaa::UserIdentifier, }, UserId, @@ -18,7 +25,7 @@ struct Claims { //exp: usize, } -/// # `GET /_matrix/client/r0/login` +/// # `GET /_matrix/client/v3/login` /// /// Get the supported login types of this server. One of these should be used as the `type` field /// when logging in. @@ -31,7 +38,7 @@ pub async fn get_login_types_route( ])) } -/// # `POST /_matrix/client/r0/login` +/// # `POST /_matrix/client/v3/login` /// /// Authenticates the user and returns an access token it can use in subsequent requests. /// @@ -166,12 +173,38 @@ pub async fn login_route(body: Ruma) -> Result