about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2023-03-06 16:00:08 +0100
committerGitHub <noreply@github.com>2023-03-06 16:00:08 +0100
commit86f8aa2db2bf4f19f482b5857c4e49b8791eb514 (patch)
treee8f79ab8f14f7cfed5ba6f2f8396882a8c88764b
parent4595862978a7f726fbd6139a1bc415cc83cf34fe (diff)
Fix unconfirmed accounts being registered as active users (#23803)
-rw-r--r--app/models/user.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 5e106dee5..d56a9b9ca 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -507,11 +507,14 @@ class User < ApplicationRecord
   def prepare_new_user!
     BootstrapTimelineWorker.perform_async(account_id)
     ActivityTracker.increment('activity:accounts:local')
+    ActivityTracker.record('activity:logins', id)
     UserMailer.welcome(self).deliver_later
     TriggerWebhookWorker.perform_async('account.approved', 'Account', account_id)
   end
 
   def prepare_returning_user!
+    return unless confirmed?
+
     ActivityTracker.record('activity:logins', id)
     regenerate_feed! if needs_feed_update?
   end