FIX: save registration_ip_address for staged users logging in via social auth

This commit is contained in:
Arpit Jalan
2017-12-12 17:38:57 +05:30
parent e2b64257b3
commit 492af81e67
2 changed files with 21 additions and 0 deletions

View File

@ -117,6 +117,7 @@ class Users::OmniauthCallbacksController < ApplicationController
# ensure there is an active email token
user.email_tokens.create(email: user.email) unless EmailToken.where(email: user.email, confirmed: true).present? || user.email_tokens.active.where(email: user.email).exists?
user.activate
user.update!(registration_ip_address: request.remote_ip) if user.registration_ip_address.blank?
end
if ScreenedIpAddress.should_block?(request.remote_ip)