diff options
-rw-r--r-- | config/initializers/warden.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/config/initializers/warden.rb b/config/initializers/warden.rb index 632fdc59dd1..841f4aa1da9 100644 --- a/config/initializers/warden.rb +++ b/config/initializers/warden.rb @@ -30,11 +30,13 @@ Rails.application.configure do |config| end Warden::Manager.before_logout(scope: :user) do |user, auth, opts| - ActiveSession.destroy(user || auth.user, auth.request.session.id) - activity = Gitlab::Auth::Activity.new(opts) tracker = Gitlab::Auth::BlockedUserTracker.new(user, auth) + ActiveSession.destroy(user || auth.user, auth.request.session.id) + + activity.user_session_destroyed! + ## # It is possible that `before_logout` event is going to be triggered # multiple times during the request lifecycle. We want to increment @@ -51,7 +53,5 @@ Rails.application.configure do |config| activity.user_blocked! tracker.log_activity! end - - activity.user_session_destroyed! end end |