]> Untitled Git - lemmy.git/blobdiff - crates/api_crud/src/post/delete.rs
Moving settings and secrets to context.
[lemmy.git] / crates / api_crud / src / post / delete.rs
index c0ef351229c731bff1e93983afb98b7f0393c98f..18ede8a3743deab835154e7597d515775fa645a9 100644 (file)
@@ -23,7 +23,8 @@ impl PerformCrud for DeletePost {
     websocket_id: Option<ConnectionId>,
   ) -> Result<PostResponse, LemmyError> {
     let data: &DeletePost = 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?;
 
     let post_id = data.post_id;
     let orig_post = blocking(context.pool(), move |conn| Post::read(conn, post_id)).await??;
@@ -83,7 +84,8 @@ impl PerformCrud for RemovePost {
     websocket_id: Option<ConnectionId>,
   ) -> Result<PostResponse, LemmyError> {
     let data: &RemovePost = 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?;
 
     let post_id = data.post_id;
     let orig_post = blocking(context.pool(), move |conn| Post::read(conn, post_id)).await??;