diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-05-07 13:13:10 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-05-07 13:13:10 +0300 |
commit | 892b371dadeec0baf28bf401d2ef26906957d81c (patch) | |
tree | b8a6be4798b5d2a07df3739a3d9131e0a89bbcbe /config | |
parent | 2d84de9ec90b87ee4e1e10ce1a4a9d00b07c39e7 (diff) | |
parent | d0bab3399fb3a043af4a815d27ac67343ae5b2ab (diff) |
Merge branch 'dm-warden-hook-scope' into 'master'
Only run session related Warden hooks for user scope
Closes gitlab-ee#5857
See merge request gitlab-org/gitlab-ce!18771
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/warden.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/config/initializers/warden.rb b/config/initializers/warden.rb index bf079f8e1a7..8cc36820d3c 100644 --- a/config/initializers/warden.rb +++ b/config/initializers/warden.rb @@ -1,21 +1,21 @@ Rails.application.configure do |config| - Warden::Manager.after_set_user do |user, auth, opts| + Warden::Manager.after_set_user(scope: :user) do |user, auth, opts| Gitlab::Auth::UniqueIpsLimiter.limit_user!(user) end - Warden::Manager.before_failure do |env, opts| + Warden::Manager.before_failure(scope: :user) do |env, opts| Gitlab::Auth::BlockedUserTracker.log_if_user_blocked(env) end - Warden::Manager.after_authentication do |user, auth, opts| + Warden::Manager.after_authentication(scope: :user) do |user, auth, opts| ActiveSession.cleanup(user) end - Warden::Manager.after_set_user only: :fetch do |user, auth, opts| + Warden::Manager.after_set_user(scope: :user, only: :fetch) do |user, auth, opts| ActiveSession.set(user, auth.request) end - Warden::Manager.before_logout do |user, auth, opts| + Warden::Manager.before_logout(scope: :user) do |user, auth, opts| ActiveSession.destroy(user || auth.user, auth.request.session.id) end end |