mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-07-16 04:08:04 +00:00
Admin can get auth options
This commit is contained in:
src
20
src/api_data/admin/admin_auth_options.rs
Normal file
20
src/api_data/admin/admin_auth_options.rs
Normal 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()
|
||||
}
|
||||
}
|
||||
}
|
5
src/api_data/admin/mod.rs
Normal file
5
src/api_data/admin/mod.rs
Normal file
@ -0,0 +1,5 @@
|
||||
//! # Admin public data
|
||||
//!
|
||||
//! @author Pierre Hubert
|
||||
|
||||
pub mod admin_auth_options;
|
@ -7,6 +7,8 @@
|
||||
//! ## Author
|
||||
//! Pierre Hubert
|
||||
|
||||
pub mod admin;
|
||||
|
||||
pub mod server_config;
|
||||
pub mod http_error;
|
||||
pub mod login_success;
|
||||
|
Reference in New Issue
Block a user