mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-21 00:45:18 +00:00
Can check if security questions has been defined
This commit is contained in:
@ -68,6 +68,10 @@ pub struct User {
|
||||
pub block_comments_on_his_page: bool,
|
||||
pub allow_posts_from_friends: bool,
|
||||
pub account_creation_time: u64,
|
||||
pub security_question_1: Option<String>,
|
||||
pub security_answer_1: Option<String>,
|
||||
pub security_question_2: Option<String>,
|
||||
pub security_answer_2: Option<String>,
|
||||
}
|
||||
|
||||
impl User {
|
||||
@ -86,4 +90,12 @@ impl User {
|
||||
pub fn has_account_image(&self) -> bool {
|
||||
self.account_image_path.is_some()
|
||||
}
|
||||
|
||||
/// Check out whether security questions have been defined for this user or not
|
||||
pub fn has_security_questions(&self) -> bool {
|
||||
self.security_question_1.is_some() &&
|
||||
self.security_answer_1.is_some() &&
|
||||
self.security_question_2.is_some() &&
|
||||
self.security_answer_2.is_some()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user