about summary refs log tree commit diff
path: root/app/controllers/authorize_interactions_controller.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-05-01 16:52:27 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-05-01 16:52:27 +0200
commit392ca0472a50ea930f46e22dccf5ce55b04ef588 (patch)
tree9f8c6b3dcb11a620a417205f9554e8d37e5f3e12 /app/controllers/authorize_interactions_controller.rb
parent252deefe3433d0cedafd973becd0d85b5182eb49 (diff)
parent33f3818d660c67194f94c7ff2bb180f4865e6748 (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `app/javascript/packs/admin.js`:
  Conflicts due to glitch-soc's theming system.
  Upstream changes have been ported to `app/javascript/core/admin.js`
- `app/models/trends/statuses.rb`:
  Minor conflict due to glitch-soc's option to allow CWed toots in trends.
  Ported upstream changes.
Diffstat (limited to 'app/controllers/authorize_interactions_controller.rb')
-rw-r--r--app/controllers/authorize_interactions_controller.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/controllers/authorize_interactions_controller.rb b/app/controllers/authorize_interactions_controller.rb
index f0bcac75b..97fe4a9ab 100644
--- a/app/controllers/authorize_interactions_controller.rb
+++ b/app/controllers/authorize_interactions_controller.rb
@@ -14,7 +14,7 @@ class AuthorizeInteractionsController < ApplicationController
     if @resource.is_a?(Account)
       render :show
     elsif @resource.is_a?(Status)
-      redirect_to web_url("statuses/#{@resource.id}")
+      redirect_to web_url("@#{@resource.account.pretty_acct}/#{@resource.id}")
     else
       render :error
     end
@@ -26,15 +26,17 @@ class AuthorizeInteractionsController < ApplicationController
     else
       render :error
     end
-  rescue ActiveRecord::RecordNotFound, Mastodon::NotPermittedError
+  rescue ActiveRecord::RecordNotFound
     render :error
   end
 
   private
 
   def set_resource
-    @resource = located_resource || render(:error)
+    @resource = located_resource
     authorize(@resource, :show?) if @resource.is_a?(Status)
+  rescue Mastodon::NotPermittedError
+    not_found
   end
 
   def located_resource