Fix require_user! behavior when not logged in (#4604)

th-downstream
abcang 7 years ago committed by Eugen Rochko
parent 5bd2dcd436
commit efd907e32e

@ -62,10 +62,11 @@ 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

Loading…
Cancel
Save