summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2017-10-13 17:05:18 -0700
committerFrancisco Lopez <fjlopez@gitlab.com>2017-11-17 09:58:18 +0100
commit43a682ccaa694d2a14f3d639d66708057859a628 (patch)
treed77db36eb817035efed3fdb2ec163615bdbc9336 /config
parentd87030714a654b0dfa47aa6b38eb970731e7a04e (diff)
downloadgitlab-ce-43a682ccaa694d2a14f3d639d66708057859a628.tar.gz
Fix OAuth API and RSS rate limiting
Diffstat (limited to 'config')
-rw-r--r--config/initializers/rack_attack_global.rb12
1 files changed, 1 insertions, 11 deletions
diff --git a/config/initializers/rack_attack_global.rb b/config/initializers/rack_attack_global.rb
index 3073ba06ac1..cf87310d7b7 100644
--- a/config/initializers/rack_attack_global.rb
+++ b/config/initializers/rack_attack_global.rb
@@ -45,7 +45,7 @@ class Rack::Attack
end
def authenticated_user_id
- session_user_id || sessionless_user_id
+ Gitlab::Auth::RequestAuthenticator.new(self).user&.id
end
def api_request?
@@ -55,15 +55,5 @@ class Rack::Attack
def web_request?
!api_request?
end
-
- private
-
- def session_user_id
- Gitlab::Auth.find_session_user(self)&.id
- end
-
- def sessionless_user_id
- Gitlab::Auth.find_sessionless_user(self)&.id
- end
end
end