Add user_id param to secondary email confirmation links
What does this MR do and why?
Add user_id param to secondary email confirmation links
To prepare for de-scoping emails.confirmation_token to be per-user
rather than globally unique, we need to ensure the controller has the
email.user_id to look up the appropriate email to confirm.
This change ensures the confirmation link only for secondary emails
(using the Email model) includes the user_id parameter. This will be
used by the confirmations controller to look up the Email record to
confirm, once the new index is in place in !214499
References
- See Epic for related MRs in-progress and rollout plan: &20097
- Must be merged after feature flag removal: !213743 (diffs)
- Part of issue: #562035
- Required for de-scoping
emails.confirmation_token: !214499
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Check the Rails mailer preview:
https://gdk.test:3443/rails/mailers/devise_mailer/confirmation_instructions_for_secondary_email.html?locale=en - Ensure the CTA link has the
user_idparameter, similar to:https://gdk.test:3443/-/profile/emails/confirmation?confirmation_token=faketoken&user_id=123
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Andrew Evans