mirror of
https://github.com/mastodon/mastodon
synced 2024-12-01 08:18:22 +09:00
Fix require_user! behavior when not logged in (#4604)
This commit is contained in:
parent
4fcbb1f838
commit
e120d09c98
@ -62,11 +62,12 @@ class Api::BaseController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def require_user!
|
def require_user!
|
||||||
current_resource_owner
|
if current_user
|
||||||
set_user_activity
|
set_user_activity
|
||||||
rescue ActiveRecord::RecordNotFound
|
else
|
||||||
render json: { error: 'This method requires an authenticated user' }, status: 422
|
render json: { error: 'This method requires an authenticated user' }, status: 422
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def render_empty
|
def render_empty
|
||||||
render json: {}, status: 200
|
render json: {}, status: 200
|
||||||
|
Loading…
Reference in New Issue
Block a user