Log when facebook doesn't provide an email address

This commit is contained in:
Neil Lalonde 2014-03-19 13:31:17 -04:00
parent 7780013c3a
commit a74764c833
2 changed files with 9 additions and 1 deletions

View File

@ -22,7 +22,8 @@ class UserHistory < ActiveRecord::Base
:notified_about_sequential_replies, :notified_about_sequential_replies,
:notified_about_dominating_topic, :notified_about_dominating_topic,
:suspend_user, :suspend_user,
:unsuspend_user) :unsuspend_user,
:facebook_no_email)
end end
# Staff actions is a subset of all actions, used to audit actions taken by staff users. # Staff actions is a subset of all actions, used to audit actions taken by staff users.

View File

@ -24,6 +24,13 @@ class Auth::FacebookAuthenticator < Auth::Authenticator
FacebookUserInfo.create({user_id: result.user.id}.merge(facebook_hash)) FacebookUserInfo.create({user_id: result.user.id}.merge(facebook_hash))
end end
if email.blank?
UserHistory.create(
action: UserHistory.actions[:facebook_no_email],
details: "name: #{facebook_hash[:name]}, facebook_user_id: #{facebook_hash[:facebook_user_id]}"
)
end
result result
end end