users: log restricted signups to NewRelic.
When a new user creates an account and their account is automatically restricted, log the reason why to NewRelic.
This commit is contained in:
@@ -70,6 +70,7 @@ class UsersController < ApplicationController
|
||||
password_confirmation: params[:user][:password_confirmation]
|
||||
)
|
||||
|
||||
user_verifier.log! if user_verifier.requires_verification?
|
||||
UserEvent.build_from_request(@user, :user_creation, request)
|
||||
|
||||
if params[:user][:email].present?
|
||||
|
||||
@@ -26,6 +26,10 @@ class UserVerifier
|
||||
end
|
||||
end
|
||||
|
||||
def log!
|
||||
DanbooruLogger.add_attributes("user_verifier", to_h)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def ip_address
|
||||
@@ -55,5 +59,9 @@ class UserVerifier
|
||||
IpLookup.new(ip_address).is_proxy?
|
||||
end
|
||||
|
||||
def to_h
|
||||
{ is_ip_banned: is_ip_banned?, is_logged_in: is_logged_in?, is_recent_signup: is_recent_signup?, is_proxy: is_proxy? }
|
||||
end
|
||||
|
||||
memoize :is_ip_banned?, :is_proxy?, :is_recent_signup?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user