mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-09-25 14:19:45 +00:00
Turned a lot of function to async mode
This commit is contained in:
@@ -94,7 +94,7 @@ pub async fn login_user(request: &mut HttpRequestHandler) -> RequestResult {
|
||||
/// Sign out user
|
||||
pub async fn logout_user(request: &mut HttpRequestHandler) -> RequestResult {
|
||||
if let Some(token) = request.user_access_token() {
|
||||
account_helper::destroy_login_tokens(token)?;
|
||||
account_helper::destroy_login_tokens(token).await?;
|
||||
}
|
||||
|
||||
request.success("User disconnected.")
|
||||
@@ -102,7 +102,7 @@ pub async fn logout_user(request: &mut HttpRequestHandler) -> RequestResult {
|
||||
|
||||
/// Disconnect a user from all his devices
|
||||
pub async fn disconnect_all_devices(r: &mut HttpRequestHandler) -> RequestResult {
|
||||
account_helper::destroy_all_user_tokens(r.user_id_ref()?)?;
|
||||
account_helper::destroy_all_user_tokens(r.user_id_ref()?).await?;
|
||||
|
||||
r.success("Successfully disconnected!")
|
||||
}
|
||||
@@ -208,7 +208,7 @@ pub async fn delete_account(r: &mut HttpRequestHandler) -> RequestResult {
|
||||
r.forbidden("You shall not delete MY account (whoever you are, please note that hacking is bad !!!)".to_string())?;
|
||||
}
|
||||
|
||||
account_helper::delete(r.user_id_ref()?)?;
|
||||
account_helper::delete(r.user_id_ref()?).await?;
|
||||
|
||||
r.success("Account deleted.")
|
||||
}
|
Reference in New Issue
Block a user