mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-26 03:11:08 +00:00
parent
82b30b5467
commit
62357f4444
1 changed files with 5 additions and 5 deletions
|
@ -46,11 +46,11 @@ pub async fn ban_from_site(
|
||||||
.await
|
.await
|
||||||
.with_lemmy_type(LemmyErrorType::CouldntUpdateUser)?;
|
.with_lemmy_type(LemmyErrorType::CouldntUpdateUser)?;
|
||||||
|
|
||||||
let local_user_id = LocalUserView::read_person(&mut context.pool(), data.person_id)
|
// if its a local user, invalidate logins
|
||||||
.await?
|
let local_user = LocalUserView::read_person(&mut context.pool(), data.person_id).await;
|
||||||
.local_user
|
if let Ok(local_user) = local_user {
|
||||||
.id;
|
LoginToken::invalidate_all(&mut context.pool(), local_user.local_user.id).await?;
|
||||||
LoginToken::invalidate_all(&mut context.pool(), local_user_id).await?;
|
}
|
||||||
|
|
||||||
// Remove their data if that's desired
|
// Remove their data if that's desired
|
||||||
let remove_data = data.remove_data.unwrap_or(false);
|
let remove_data = data.remove_data.unwrap_or(false);
|
||||||
|
|
Loading…
Reference in a new issue