Commit d0bfe999 authored by Valery Sizov's avatar Valery Sizov

[CE->EE] Better way to solve collision of log_failed_login method name

parent d69d0c0f
......@@ -15,7 +15,7 @@ class SessionsController < Devise::SessionsController
before_action :auto_sign_in_with_provider, only: [:new]
before_action :load_recaptcha
after_action :log_failed_login, only: [:new]
after_action :log_failed_login, only: [:new], if: :failed_login?
def new
set_minimum_password_length
......@@ -48,8 +48,6 @@ class SessionsController < Devise::SessionsController
private
def log_failed_login
return unless failed_login?
Gitlab::AppLogger.info("Failed Login: username=#{user_params[:login]} ip=#{request.remote_ip}")
end
......
......@@ -2,19 +2,13 @@ module EE
module SessionsController
extend ActiveSupport::Concern
prepended do
after_action :log_failed_login_ee, only: :new, if: :failed_login?
end
private
def log_failed_login_ee
def log_failed_login
::AuditEventService.new(request.filtered_parameters['user']['login'], nil, ip_address: request.remote_ip)
.for_failed_login.unauth_security_event
end
def failed_login?
env['warden.options'] && env['warden.options'][:action] == 'unauthenticated'
super
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment