New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix unconfirmed accounts being registered as active users #23803
Fix unconfirmed accounts being registered as active users #23803
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would make sense to rename these methods to after_sign_up!
and after_sign_in!
?
app/models/user.rb
Outdated
UserMailer.welcome(self).deliver_later | ||
TriggerWebhookWorker.perform_async('account.approved', 'Account', account_id) | ||
end | ||
|
||
def prepare_returning_user! | ||
ActivityTracker.record('activity:logins', id) | ||
ActivityTracker.record('activity:logins', id) if confirmed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to execute this entire method if neither confirmed?
nor approved?
are true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it for a guard clause, but I'm uncomfortable with changing the behavior further wrt. approved?
.
ff81470
to
9d8b656
Compare
The total user count is the total of users who have confirmed their email address, but the active user count also includes users who have not.
Note that confirmed but not-approved users remain part of the total user count and may be considered as active as well. Maybe we should change that too.