1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-03-14 01:42:37 +00:00
comunicapiv3/src/api_data/admin/admin_auth_options.rs

20 lines
351 B
Rust
Raw Normal View History

2021-05-09 16:29:59 +02:00
//! # Admin auth options API structure
//!
//! @author Pierre Hubert
use serde::Serialize;
use crate::data::admin::Admin;
#[derive(Serialize)]
pub struct AdminAuthOptions {
2021-05-11 17:45:26 +02:00
reset_token: bool,
2021-05-09 16:29:59 +02:00
}
impl AdminAuthOptions {
pub fn new(admin: &Admin) -> Self {
Self {
2021-05-11 17:45:26 +02:00
reset_token: admin.reset_token.is_some()
2021-05-09 16:29:59 +02:00
}
}
}