Skip to content
Snippets Groups Projects
Commit e120d09c authored by abcang's avatar abcang Committed by Eugen Rochko
Browse files

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

parent 4fcbb1f8
No related branches found
No related tags found
No related merge requests found
......@@ -62,10 +62,11 @@ class Api::BaseController < ApplicationController
end
def require_user!
current_resource_owner
set_user_activity
rescue ActiveRecord::RecordNotFound
render json: { error: 'This method requires an authenticated user' }, status: 422
if current_user
set_user_activity
else
render json: { error: 'This method requires an authenticated user' }, status: 422
end
end
def render_empty
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment