Fix change breaking sharekey functionality

master
Holly 'Frinkel' Lotor 2020-01-22 06:56:17 +00:00
parent 8b96e669e9
commit 4c146300ff
1 changed files with 7 additions and 1 deletions

View File

@ -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