continuwuity/src/api/server/openid.rs
strawberry 77e0b76408
apply new rustfmt.toml changes, fix some clippy lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-12-15 01:00:41 -05:00

19 lines
546 B
Rust

use axum::extract::State;
use ruma::api::federation::openid::get_openid_userinfo;
use crate::{Result, Ruma};
/// # `GET /_matrix/federation/v1/openid/userinfo`
///
/// Get information about the user that generated the OpenID token.
pub(crate) async fn get_openid_userinfo_route(
State(services): State<crate::State>,
body: Ruma<get_openid_userinfo::v1::Request>,
) -> Result<get_openid_userinfo::v1::Response> {
Ok(get_openid_userinfo::v1::Response::new(
services
.users
.find_from_openid_token(&body.access_token)
.await?,
))
}