diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-07-23 16:13:11 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-07-23 16:13:11 +0300 |
commit | 68547bc0e0e3f85e8ac07c6f81c316e1f4456758 (patch) | |
tree | 2d7b038b56e238ae68354afecf092cb09bf8e473 /config/initializers/warden.rb | |
parent | 1a39d24d2034ce0d87cd5df630f1226d0beb7dd2 (diff) |
Track blocked users and two factor authentications
Diffstat (limited to 'config/initializers/warden.rb')
-rw-r--r-- | config/initializers/warden.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/config/initializers/warden.rb b/config/initializers/warden.rb index 3a81a9a127a..bd552e2a96b 100644 --- a/config/initializers/warden.rb +++ b/config/initializers/warden.rb @@ -18,17 +18,16 @@ Rails.application.configure do |config| Warden::Manager.after_set_user(scope: :user, only: :fetch) do |user, auth, opts| ActiveSession.set(user, auth.request) - Gitlab::Auth::Activity.new(user, opts).user_session_fetched! end Warden::Manager.after_set_user(scope: :user, only: :set_user) do |user, auth, opts| Gitlab::Auth::Activity.new(user, opts).user_session_override! end - Warden::Manager.before_logout(scope: :user) do |warden_user, auth, opts| - (warden_user || auth.user).tap do |user| - ActiveSession.destroy(user, auth.request.session.id) - Gitlab::Auth::Activity.new(user, opts).user_signed_out! - end + Warden::Manager.before_logout(scope: :user) do |user_warden, auth, opts| + user = user_warden || auth.user + + ActiveSession.destroy(user, auth.request.session.id) + Gitlab::Auth::Activity.new(user, opts).user_signed_out! end end |