Updated all instances of request.remote_ip to use new ip headers

• Updated:
- all instances of request.remote_ip to use new ip headers
This commit is contained in:
Developer
2021-02-26 12:50:25 -05:00
parent 4d43158fe2
commit 3f90b0be69
2 changed files with 5 additions and 4 deletions

View File

@@ -43,7 +43,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController
resource.locale = I18n.locale
resource.agreement = true
resource.current_sign_in_ip = request.remote_ip
resource.current_sign_in_ip = request.headers['True-Client-IP'] || request.remote_ip
resource.build_account if resource.account.nil?
end
@@ -132,7 +132,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController
"serverKey" => ENV.fetch('GAB_CAPTCHA_SECRET_KEY', ''),
"value" => typedChallenge,
"username" => username,
"ip" => request.headers['True-Client-IP']
"ip" => request.headers['True-Client-IP'] || request.remote_ip
}).perform do |res|
body = JSON.parse(res.body_with_limit)
result = !!body["success"]