mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-20 16:35:17 +00:00
Can set security settings
This commit is contained in:
@ -31,4 +31,5 @@ pub mod account_export;
|
||||
pub mod user_like;
|
||||
pub mod survey_response;
|
||||
pub mod general_settings;
|
||||
pub mod lang_settings;
|
||||
pub mod lang_settings;
|
||||
pub mod security_settings;
|
32
src/data/security_settings.rs
Normal file
32
src/data/security_settings.rs
Normal file
@ -0,0 +1,32 @@
|
||||
//! # Security settings
|
||||
//!
|
||||
//! Security settings of a user
|
||||
|
||||
use crate::data::user::UserID;
|
||||
|
||||
pub struct SecurityQuestion(Option<String>, Option<String>);
|
||||
|
||||
impl SecurityQuestion
|
||||
{
|
||||
pub fn new(question: &Option<String>, answer: &Option<String>) -> SecurityQuestion
|
||||
{
|
||||
SecurityQuestion(question.clone(), answer.clone())
|
||||
}
|
||||
|
||||
pub fn question(&self) -> Option<String>
|
||||
{
|
||||
self.0.clone()
|
||||
}
|
||||
|
||||
pub fn answer(&self) -> Option<String>
|
||||
{
|
||||
self.1.clone()
|
||||
}
|
||||
}
|
||||
|
||||
pub struct SecuritySettings
|
||||
{
|
||||
pub id: UserID,
|
||||
pub question1: SecurityQuestion,
|
||||
pub question2: SecurityQuestion,
|
||||
}
|
Reference in New Issue
Block a user