2017-02-21 16:17:23 -05:00
|
|
|
Rails.application.configure do |config|
|
2018-05-07 04:13:27 -04:00
|
|
|
Warden::Manager.after_set_user(scope: :user) do |user, auth, opts|
|
2017-02-21 16:17:23 -05:00
|
|
|
Gitlab::Auth::UniqueIpsLimiter.limit_user!(user)
|
|
|
|
end
|
2018-01-15 00:10:48 -05:00
|
|
|
|
2018-05-07 04:13:27 -04:00
|
|
|
Warden::Manager.before_failure(scope: :user) do |env, opts|
|
2018-01-15 00:10:48 -05:00
|
|
|
Gitlab::Auth::BlockedUserTracker.log_if_user_blocked(env)
|
|
|
|
end
|
2018-05-02 04:08:16 -04:00
|
|
|
|
2018-05-07 04:13:27 -04:00
|
|
|
Warden::Manager.after_authentication(scope: :user) do |user, auth, opts|
|
2018-05-02 04:08:16 -04:00
|
|
|
ActiveSession.cleanup(user)
|
|
|
|
end
|
|
|
|
|
2018-05-07 04:13:27 -04:00
|
|
|
Warden::Manager.after_set_user(scope: :user, only: :fetch) do |user, auth, opts|
|
2018-05-02 04:08:16 -04:00
|
|
|
ActiveSession.set(user, auth.request)
|
|
|
|
end
|
|
|
|
|
2018-05-07 04:13:27 -04:00
|
|
|
Warden::Manager.before_logout(scope: :user) do |user, auth, opts|
|
2018-05-02 04:08:16 -04:00
|
|
|
ActiveSession.destroy(user || auth.user, auth.request.session.id)
|
|
|
|
end
|
2017-02-21 16:17:23 -05:00
|
|
|
end
|