Merge pull request #4913 from pixelfed/staging

Fix api endpoints
This commit is contained in:
daniel 2024-02-09 20:45:44 -07:00 committed by GitHub
commit 67167a5b90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3691,8 +3691,7 @@ class ApiV1Controller extends Controller
*/ */
public function statusReplies(Request $request, $id) public function statusReplies(Request $request, $id)
{ {
abort_if(!$request->user() || !$request->user()->token(), 403); abort_if(!$request->user(), 403);
abort_unless($request->user()->tokenCan('read'), 403);
$this->validate($request, [ $this->validate($request, [
'limit' => 'int|min:1|max:10', 'limit' => 'int|min:1|max:10',
@ -3788,8 +3787,7 @@ class ApiV1Controller extends Controller
*/ */
public function statusState(Request $request, $id) public function statusState(Request $request, $id)
{ {
abort_if(!$request->user() || !$request->user()->token(), 403); abort_if(!$request->user(), 403);
abort_unless($request->user()->tokenCan('read'), 403);
$status = Status::findOrFail($id); $status = Status::findOrFail($id);
$pid = $request->user()->profile_id; $pid = $request->user()->profile_id;