mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-19 00:33:17 +00:00
Fix incorrect redirect in response to unauthenticated API requests in limited federation mode (#34549)
This commit is contained in:
parent
0e026eafef
commit
d5a905f1c8
2 changed files with 24 additions and 1 deletions
|
|
@ -141,6 +141,13 @@ class Api::BaseController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
# Redefine `require_functional!` to properly output JSON instead of HTML redirects
|
||||
def require_functional!
|
||||
return if current_user.functional?
|
||||
|
||||
require_user!
|
||||
end
|
||||
|
||||
def render_empty
|
||||
render json: {}, status: 200
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue