summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorPawel Chojnacki <pawel@chojnacki.ws>2017-02-06 13:48:46 +0100
committerPawel Chojnacki <pawel@chojnacki.ws>2017-03-06 15:41:24 +0100
commite5cf3f51fb568361a247d715facb6cd9bb15bb16 (patch)
treed12f9644c8b0dd0765fd0de90d69027848341083 /app/controllers
parent27729aa3a4666c6b06006c76023f4bff60f8ba25 (diff)
downloadgitlab-ce-e5cf3f51fb568361a247d715facb6cd9bb15bb16.tar.gz
Allow limiting logging in users from too many different IPs.
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/sessions_controller.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index 7d81c96262f..3f5b92d9a99 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -67,10 +67,12 @@ class SessionsController < Devise::SessionsController
end
def find_user
- if session[:otp_user_id]
- User.find(session[:otp_user_id])
- elsif user_params[:login]
- User.by_login(user_params[:login])
+ Gitlab::Auth::UniqueIpsLimiter.limit_user! do
+ if session[:otp_user_id]
+ User.find(session[:otp_user_id])
+ elsif user_params[:login]
+ User.by_login(user_params[:login])
+ end
end
end