Locale URLParam not preserved in forgot password workflow
Description
Using our default theme, the locale parameter is not preserved in the forgot password workflow
Observed versions
Lastest
Affects versions
Steps to reproduce
Steps to reproduce the behavior:
- Visit the authorize page with a link and locale. IE-
https://local.fusionauth.io/oauth2/authorize?client_id=85a03867-dccf-4882-adde-1a79aeec50df&response_type=code&redirect_uri=http%3A%2F%2Fpiedpiper.com%2Foauth-callback&locale=fr - Have a user click on the link.
- See that the link sent to the user does not preserve the locale
Expected behavior
We document our order of preference for locale finding, we suggest that the &locale=fr is a top level value.
See doc
We should preserve this in the forgot password link sent to the user. Additionally the link in the authorize.ftl should preserve this value.
IE
- [#macro link url extraParameters=""]
<a href="${url}?tenantId=${(tenantId)!''}&client_id=${(client_id)!''}&nonce=${(nonce?url)!''}&pendingIdPLinkId=${(pendingIdPLinkId)!''}&redirect_uri=${(redirect_uri?url)!''}&response_mode=${(response_mode?url)!''}&response_type=${(response_type?url)!''}&scope=${(scope?url)!''}&state=${(state?url)!''}&timezone=${(timezone?url)!''}&metaData.device.name=${(metaData.device.name?url)!''}&metaData.device.type=${(metaData.device.type?url)!''}${(extraParameters!'')?no_esc}&code_challenge=${(code_challenge?url)!''}&code_challenge_method=${(code_challenge_method?url)!''}&user_code=${(user_code?url)!''}">
[#nested/]
</a>
[/#macro]
Should be
.... &locale=${(locale?url)!''}
And capture state - https://github.com/FusionAuth/fusionauth-app/blob/7f1bd0c749f8c564c5a8f26922674a2d8ce6be72/src/main/java/io/fusionauth/app/action/oauth2/BaseOAuthAction.java#L583 - should add
"locale", locale,
Screenshots
If applicable, add screenshots to help explain your problem. Delete this section if it is not applicable.
Platform
(Please complete the following information)
- Device: [e.g. Desktop, iPhone X, Pixel 3, etc]
- OS: [e.g. iOS, macOS, Windows ME]
- Browser + version [e.g. chrome, safari plus a version]
- Database [MySQL | PostgresSQL] & and version
Community guidelines
All issues filed in this repository must abide by the FusionAuth community guidelines.
Additional context
Add any other context about the problem here.
Is this a duplicate of https://github.com/FusionAuth/fusionauth-issues/issues/2328? Please re-open if this issue still remains. Thanks!
Still an active bug based on my testing
I also tested the passwordless (magic link) and verify email templates and the same behavior is happening where the locale is not preserved. A workaround is to set a preferredLanguage for the User.
Per the comments above, looks like we didn't fix this issue with https://github.com/FusionAuth/fusionauth-issues/issues/2328.