]> Untitled Git - lemmy.git/commitdiff
Don't allow deleted users to do actions. Fixes #1656 (#1704)
authorDessalines <dessalines@users.noreply.github.com>
Mon, 16 Aug 2021 20:51:08 +0000 (16:51 -0400)
committerGitHub <noreply@github.com>
Mon, 16 Aug 2021 20:51:08 +0000 (20:51 +0000)
crates/api_common/src/lib.rs

index 4e3cd751bd84437b598e24db8dc01eae5a004bc5..1f62a8f3e10148aed8117198206025958faaab4e 100644 (file)
@@ -272,6 +272,11 @@ pub async fn get_local_user_view_from_jwt(
     return Err(ApiError::err("site_ban").into());
   }
 
+  // Check for user deletion
+  if local_user_view.person.deleted {
+    return Err(ApiError::err("deleted").into());
+  }
+
   check_validator_time(&local_user_view.local_user.validator_time, &claims)?;
 
   Ok(local_user_view)