debian-mirror-gitlab/config/initializers/warden.rb

22 lines
694 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
Rails.application.configure do |config|
2018-10-15 14:42:47 +05:30
Warden::Manager.after_set_user(scope: :user) do |user, auth, opts|
2017-08-17 22:00:37 +05:30
Gitlab::Auth::UniqueIpsLimiter.limit_user!(user)
end
2018-03-17 18:26:18 +05:30
2018-10-15 14:42:47 +05:30
Warden::Manager.before_failure(scope: :user) do |env, opts|
2018-03-17 18:26:18 +05:30
Gitlab::Auth::BlockedUserTracker.log_if_user_blocked(env)
end
2018-10-15 14:42:47 +05:30
Warden::Manager.after_authentication(scope: :user) do |user, auth, opts|
ActiveSession.cleanup(user)
end
Warden::Manager.after_set_user(scope: :user, only: :fetch) do |user, auth, opts|
ActiveSession.set(user, auth.request)
end
Warden::Manager.before_logout(scope: :user) do |user, auth, opts|
ActiveSession.destroy(user || auth.user, auth.request.session.id)
end
2017-08-17 22:00:37 +05:30
end