FusionAuth / fusionauth-issues

FusionAuth issue submission project
https://fusionauth.io
91 stars 12 forks source link

Locale URLParam not preserved in forgot password workflow #2819

Open jobannon opened 4 months ago

jobannon commented 4 months ago

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:

  1. 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
  2. Have a user click on the link.
  3. 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)

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.

robotdan commented 2 months ago

Is this a duplicate of https://github.com/FusionAuth/fusionauth-issues/issues/2328? Please re-open if this issue still remains. Thanks!

jobannon commented 1 month ago

Still an active bug based on my testing

mrudatsprint commented 1 month ago

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.