Start Matrix client authentication
This commit is contained in:
14
matrixgw_backend/src/controllers/matrix_link_controller.rs
Normal file
14
matrixgw_backend/src/controllers/matrix_link_controller.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use crate::controllers::HttpResult;
|
||||
use crate::extractors::matrix_client_extractor::MatrixClientExtractor;
|
||||
use actix_web::HttpResponse;
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
struct StartAuthResponse {
|
||||
url: String,
|
||||
}
|
||||
|
||||
/// Start user authentication on Matrix server
|
||||
pub async fn start_auth(client: MatrixClientExtractor) -> HttpResult {
|
||||
let url = client.client.initiate_login().await?.to_string();
|
||||
Ok(HttpResponse::Ok().json(StartAuthResponse { url }))
|
||||
}
|
||||
Reference in New Issue
Block a user