From 4c146300ffaccd3a30c587d1e9166d69ef493417 Mon Sep 17 00:00:00 2001 From: Holly 'Frinkel' Lotor Date: Wed, 22 Jan 2020 06:56:17 +0000 Subject: Fix change breaking sharekey functionality --- app/controllers/statuses_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/controllers/statuses_controller.rb') 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 -- cgit