/
Undeadguy
/
conduit
Обзор
Документация
Войти
/
Undeadguy
/
conduit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
src/api/client_server/openid.rs
23 строки
835 B
mikoto
OpenID routes
28 май 2024, 17:39
28 май 2024, 17:39
a888c7c
Код
Авторство
О чём код?
use std::time::Duration; use ruma::{api::client::account, authentication::TokenType}; use crate::{services, Result, Ruma}; /// # `POST /_matrix/client/r0/user/{userId}/openid/request_token` /// /// Request an OpenID token to verify identity with third-party services. /// /// - The token generated is only valid for the OpenID API. pub async fn create_openid_token_route( body: Ruma<account::request_openid_token::v3::Request>, ) -> Result<account::request_openid_token::v3::Response> { let (access_token, expires_in) = services().users.create_openid_token(&body.user_id)?; Ok(account::request_openid_token::v3::Response { access_token, token_type: TokenType::Bearer, matrix_server_name: services().globals.server_name().to_owned(), expires_in: Duration::from_secs(expires_in), }) }