mas_handlers/compat/
mod.rs

1// Copyright 2024 New Vector Ltd.
2// Copyright 2022-2024 The Matrix.org Foundation C.I.C.
3//
4// SPDX-License-Identifier: AGPL-3.0-only
5// Please see LICENSE in the repository root for full details.
6
7use axum::{Json, response::IntoResponse};
8use hyper::StatusCode;
9use serde::Serialize;
10
11pub(crate) mod login;
12pub(crate) mod login_sso_complete;
13pub(crate) mod login_sso_redirect;
14pub(crate) mod logout;
15pub(crate) mod refresh;
16
17#[derive(Debug, Serialize)]
18struct MatrixError {
19    errcode: &'static str,
20    error: &'static str,
21    #[serde(skip)]
22    status: StatusCode,
23}
24
25impl IntoResponse for MatrixError {
26    fn into_response(self) -> axum::response::Response {
27        (self.status, Json(self)).into_response()
28    }
29}