use std::time::Duration;
use salvo::prelude::*;
use serde::Serialize;
use crate::{OwnedServerName, authentication::TokenType};
#[derive(ToSchema, Serialize, Debug)]
pub struct RequstOpenidTokenResBody {
pub access_token: String,
pub token_type: TokenType,
pub matrix_server_name: OwnedServerName,
#[serde(with = "crate::serde::duration::secs")]
pub expires_in: Duration,
}
impl RequstOpenidTokenResBody {
pub fn new(
access_token: String,
token_type: TokenType,
matrix_server_name: OwnedServerName,
expires_in: Duration,
) -> Self {
Self {
access_token,
token_type,
matrix_server_name,
expires_in,
}
}
}