diff options
author | Holly 'Frinkel' Lotor <admin@frinkel.tech> | 2020-01-22 06:56:17 +0000 |
---|---|---|
committer | Holly 'Frinkel' Lotor <admin@frinkel.tech> | 2020-01-22 01:57:23 -0500 |
commit | 4c146300ffaccd3a30c587d1e9166d69ef493417 (patch) | |
tree | 35dd9764bafc6b095fe4f0c9ba57d99fa1ff8d1f /app/controllers | |
parent | 8b96e669e93fc2c82c334b8085be7921f726ba60 (diff) |
Fix change breaking sharekey functionality
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/statuses_controller.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/statuses_controller.rb b/app/controllers/statuses_controller.rb index 1e7adb7da..f95f1dfe0 100644 --- a/app/controllers/statuses_controller.rb +++ b/app/controllers/statuses_controller.rb @@ -67,7 +67,13 @@ class StatusesController < ApplicationController def set_status @status = @account.statuses.find(params[:id]) - authorize @status, :show? + @sharekey = params[:key] + + if @status.sharekey.present? && @sharekey == @status.sharekey.key + skip_authorization + else + authorize @status, :show? + end rescue Mastodon::NotPermittedError raise ActiveRecord::RecordNotFound end |