mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-21 08:55:16 +00:00
Can check if an email address exists or not
This commit is contained in:
@ -77,6 +77,14 @@ pub fn get_user_by_login_token(token: &str, client: &APIClient) -> ResultBoxErro
|
||||
)
|
||||
}
|
||||
|
||||
/// Check out whether an email address exists or not
|
||||
pub fn exists_mail(mail: &str) -> ResultBoxError<bool> {
|
||||
database::QueryInfo::new(USERS_TABLE)
|
||||
.cond("mail", mail)
|
||||
.exec_count()
|
||||
.map(|r| r > 0)
|
||||
}
|
||||
|
||||
/// Destroy a given user login tokens
|
||||
pub fn destroy_login_tokens(id: &UserID, client: &APIClient) -> ResultBoxError<()> {
|
||||
database::delete(DeleteQuery::new(USER_ACCESS_TOKENS_TABLE)
|
||||
|
Reference in New Issue
Block a user