Fix incorrect redirect in response to unauthenticated API requests in limited federation mode (#34549)
This commit is contained in:
parent
038d3b1513
commit
843a5446e8
2 changed files with 25 additions and 4 deletions
|
@ -72,6 +72,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