about summary refs log tree commit diff
path: root/app/controllers/authorize_interactions_controller.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-05-01 00:56:34 +0200
committerGitHub <noreply@github.com>2022-05-01 00:56:34 +0200
commit33f3818d660c67194f94c7ff2bb180f4865e6748 (patch)
tree8358d86e84e6ee2cc2f16cdcaf619579e9142331 /app/controllers/authorize_interactions_controller.rb
parent6e4d932da53ba236699285ce2bdfcfa07b259fa2 (diff)
Fix double render error when authorizing interaction (#18203)
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 29c0288d0..02a6b6d06 100644
--- a/app/controllers/authorize_interactions_controller.rb
+++ b/app/controllers/authorize_interactions_controller.rb
@@ -13,7 +13,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
@@ -25,15 +25,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