Commit cab8b882 authored by Marcos Rocha's avatar Marcos Rocha Committed by Alper Akgun

Use the remote ip for the captcha check

The remote ip should be used in the Captcha check instead of the ip

Changelog: added
MR:
EE: true
parent df6a15b8
......@@ -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