summaryrefslogtreecommitdiff
path: root/lib/api/api.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-03-06 16:22:46 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-03-06 16:22:46 +0000
commita4dd5792616b6bdc905a1f9ebbd2271fb6e3c34c (patch)
treedfe02d37dc708c2e3fa1b18ae9d0cd72b9f99e3f /lib/api/api.rb
parent0a58a8c8258d26e7f5c782ca1cce8665d230fa83 (diff)
parent70b9d8da4c24bc2317220bedb81b5d2ecf34c351 (diff)
downloadgitlab-ce-a4dd5792616b6bdc905a1f9ebbd2271fb6e3c34c.tar.gz
Merge branch '27520-option-to-prevent-signing-in-from-multiple-ips' into 'master'
GitLab should have an option to prevent users from signing in from multiple IPs Closes #27520 See merge request !8998
Diffstat (limited to 'lib/api/api.rb')
-rw-r--r--lib/api/api.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api/api.rb b/lib/api/api.rb
index 89449ce8813..efbb56ecd2c 100644
--- a/lib/api/api.rb
+++ b/lib/api/api.rb
@@ -60,6 +60,10 @@ module API
error! e.message, e.status, e.headers
end
+ rescue_from Gitlab::Auth::TooManyIps do |e|
+ rack_response({ 'message' => '403 Forbidden' }.to_json, 403)
+ end
+
rescue_from :all do |exception|
handle_api_exception(exception)
end