Skip to content
Snippets Groups Projects
Unverified Commit f62ee1dd authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Disable API access when login is disabled (#7289)

parent 295e3ef0
No related branches found
No related tags found
No related merge requests found
......@@ -66,8 +66,10 @@ class Api::BaseController < ApplicationController
end
def require_user!
if current_user
if current_user && !current_user.disabled?
set_user_activity
elsif current_user
render json: { error: 'Your login is currently disabled' }, status: 403
else
render json: { error: 'This method requires an authenticated user' }, status: 422
end
......
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