HOLD: Add email change notifications and password change tracking#1313
Open
HOLD: Add email change notifications and password change tracking#1313
Conversation
- Add account_email_change_requested notification when Devise sends reconfirmation email (distinct from initial account_confirmation) - Add account_email_changed notification (after_commit) when email actually changes after confirmation - Track auth.email_change_requested_email_sent ahoy event for reconfirmation emails (shows in user activity feed) - Track auth.password_changed ahoy event via User model callback so all password change paths are covered - Add DeviseMailer, Notification, and User model specs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
App uses unlock_strategy: :none so user_unlock_url doesn't exist and the Devise unlock view can't render in tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the goal of this PR and why is this important?
How did you approach the change?
account_email_change_requestednotification kind — created in DeviseMailer when a reconfirmation email is sent (distinct from initialaccount_confirmation)account_email_changednotification kind — created viaafter_commiton User when the email column actually changes after confirmationauth.email_change_requested_email_sentahoy event in DeviseMailer for reconfirmation emailsauth.password_changedahoy event via User model callback (saved_change_to_encrypted_password?) so all password change paths are covered (user self-service, Devise reset, admin edit)track_password_changed,create_email_changed_notification, andtrack_email_changeAnything else to add?
account_email_change_requestedusesunconfirmed_emailas recipient (the new address), whileaccount_email_changeduses the confirmed new emaildeliver: false— no separate emails are sent, they serve as audit recordsauth.password_changedmodel callback may fire alongside existing controller-level tracking inUsersController#update_passwordandPasswordsController#update; the model callback ensures admin-initiated password changes are also tracked🤖 Generated with Claude Code