Add organization to account email links
What does this MR do and why?
Adds organization_id to links sent in Devise mailers, so that user confirmations, password resets and unlocks can be routed to the correct cell.
Part 1 of 2 for de-scoping multiple UNIQUE indexes on the users table. We need to add organization_id to the links sent via email in these cases. Users will generally be clicking through these email links unauthenticated, so the requests have to be route-able to the correct cell.
Once emails sent out are route-able, we can de-scope the indexes so that confirmation_token , reset_password_token , and unlock_token are unique per-organization rather than globally. Changing indexes will be part 2 / 2.
References
Screenshots or screen recordings
| Before | After |
|---|---|
|
How to set up and validate locally
- Use the Rails mailer previews: https://gdk.test:3443/rails/mailers
- Confirmation instructions: https://gdk.test:3443/rails/mailers/devise_mailer/confirmation_instructions_for_new_email
- Reset password instructions: https://gdk.test:3443/rails/mailers/devise_mailer/reset_password_instructions
- Unlock instructions: https://gdk.test:3443/rails/mailers/devise_mailer/unlock_instructions
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.
Related to #562090
