🌐 Login code emails in the wrong language
Login code, registration and password reset emails were always sent in English, even when the login page was displayed in another language and the account had a different language saved (#3274). The email locale was read from a header that the locale middleware sets for pages but never for /api routes, which is where the auth endpoints live, so every auth email fell back to the default.
Auth emails now resolve their language in this order:
- The saved language of the account the address belongs to, if there is one. The person requesting a code is not always the person receiving it, so the recipient's own preference wins over the requesting device.
- The
rallly_localecookie of the requesting browser. - The browser's
Accept-Languageheader. - English.
Thanks to @deraljoscha for the report and the accurate diagnosis.
Note
There are no configuration or database changes, and no migrations ship in this release. Rallly Cloud was affected too and receives the same fix.
What's Changed
- 🐛 Send login code emails in the requester's language (#3275)
Full Changelog: v4.15.0...v4.15.1