Commit b2763de7 authored by Alper Akgun's avatar Alper Akgun

Merge branch 'mc_rocha-get-correct-request-ip' into 'master'

Use the remote ip for the captcha check

See merge request gitlab-org/gitlab!83985
parents 3ef0cb53 cab8b882
......@@ -17,7 +17,7 @@ module API
not_found! 'User' unless Feature.enabled?(:arkose_labs_login_challenge, default_enabled: :yaml)
rate_limit_reached = false
check_rate_limit!(:search_rate_limit_unauthenticated, scope: [request.ip]) do
check_rate_limit!(:search_rate_limit_unauthenticated, scope: [ip_address]) do
rate_limit_reached = true
end
......@@ -26,7 +26,7 @@ module API
else
user = ::User.by_login(params[:username])
not_found! 'User' unless user
present(::Users::CaptchaChallengeService.new(user, request.ip).execute, with: Entities::CaptchaCheck)
present(::Users::CaptchaChallengeService.new(user, ip_address).execute, with: Entities::CaptchaCheck)
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