1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-07-07 16:22:48 +00:00

Admin can get auth options

This commit is contained in:
2021-05-09 16:29:59 +02:00
parent ffe6d464d7
commit 25830fe6d1
4 changed files with 35 additions and 3 deletions

View File

@ -0,0 +1,20 @@
//! # Admin auth options API structure
//!
//! @author Pierre Hubert
use serde::Serialize;
use crate::data::admin::Admin;
#[derive(Serialize)]
pub struct AdminAuthOptions {
access_token: bool,
}
impl AdminAuthOptions {
pub fn new(admin: &Admin) -> Self {
Self {
access_token: admin.reset_token.is_some()
}
}
}

View File

@ -0,0 +1,5 @@
//! # Admin public data
//!
//! @author Pierre Hubert
pub mod admin_auth_options;