]> Untitled Git - lemmy.git/blobdiff - crates/api_crud/src/community/delete.rs
Moving settings and secrets to context.
[lemmy.git] / crates / api_crud / src / community / delete.rs
index b957b7d6edc741a6e352ede399358593a9d05672..2d54ff52c6bc89f6a0f7bc937839a7190a45c796 100644 (file)
@@ -21,7 +21,8 @@ impl PerformCrud for DeleteCommunity {
     websocket_id: Option<ConnectionId>,
   ) -> Result<CommunityResponse, LemmyError> {
     let data: &DeleteCommunity = self;
-    let local_user_view = get_local_user_view_from_jwt(&data.auth, context.pool()).await?;
+    let local_user_view =
+      get_local_user_view_from_jwt(&data.auth, context.pool(), context.secret()).await?;
 
     // Fetch the community mods
     let community_id = data.community_id;
@@ -75,7 +76,8 @@ impl PerformCrud for RemoveCommunity {
     websocket_id: Option<ConnectionId>,
   ) -> Result<CommunityResponse, LemmyError> {
     let data: &RemoveCommunity = self;
-    let local_user_view = get_local_user_view_from_jwt(&data.auth, context.pool()).await?;
+    let local_user_view =
+      get_local_user_view_from_jwt(&data.auth, context.pool(), context.secret()).await?;
 
     // Verify its an admin (only an admin can remove a community)
     is_admin(&local_user_view)?;