1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-07-16 04:08:04 +00:00

Can disconnect a user from all its devices

This commit is contained in:
2020-07-13 11:56:49 +02:00
parent ee5f9bedc3
commit c2c6a24b29
3 changed files with 15 additions and 0 deletions

@ -87,6 +87,13 @@ pub fn destroy_login_tokens(id: &UserID, client: &APIClient) -> ResultBoxError<(
Ok(())
}
/// Destroy all login tokens of a user
pub fn destroy_all_user_tokens(id: &UserID) -> ResultBoxError {
database::DeleteQuery::new(USER_ACCESS_TOKENS_TABLE)
.cond_user_id("user_id", id)
.exec()
}
/// Check out whether a virtual directory is taken by a user or not
pub fn check_user_directory_availability(dir: &str, user_id: Option<UserID>) -> ResultBoxError<bool> {
let found_user = user_helper::find_user_by_virtual_directory(dir);