Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(settings): Redirect from React email first with email param #18579

Merged
merged 1 commit into from
Mar 25, 2025

Conversation

vpomerleau
Copy link
Contributor

Because

  • Navigating to react email first with an email param was causing an infinite redirect

This pull request

  • If an email is provided, check email status and redirect appropriately to signin or signup

Issue that this pull request solves

Closes: FXA-11327

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).

Screenshots (Optional)

Please attach the screenshots of the changes made in case of change in user interface.

Other information (Optional)

Container tests will be added in follow-up FXA-11316

@vpomerleau vpomerleau requested a review from a team as a code owner March 20, 2025 19:16
@vpomerleau vpomerleau marked this pull request as draft March 20, 2025 21:12
@vpomerleau vpomerleau force-pushed the FXA-11327 branch 2 times, most recently from 832d49a to 0b6cfad Compare March 20, 2025 23:05
@vpomerleau vpomerleau marked this pull request as ready for review March 20, 2025 23:30
@dschom dschom self-requested a review March 21, 2025 20:29
// We can also use useNavigateWithQuery after addressing the above.
params.delete('email');
const hasParams = params.size > 0;
const isOAuth = location.pathname.startsWith('/oauth');
Copy link
Contributor

@dschom dschom Mar 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this use the isOauthIntegration(integration) instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated!

console.log(
`${signupRoute}${hasParams ? `?${params.toString()}` : ''}`
);
navigate(`${signupRoute}${hasParams ? `?${params.toString()}` : ''}`, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If params is empty, toString() will result in '' anyway, so I don't see the need for the ternary operator.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use the URL API instead of this ternary.

Because:

* Navigating to react email first with an email param was causing an infinite redirect

This commit:

* If an email is provided, check email status and redirect appropriately to signin or signup

Closes #FXA-11327
@vpomerleau vpomerleau merged commit fb3aafd into main Mar 25, 2025
23 checks passed
@vpomerleau vpomerleau deleted the FXA-11327 branch March 25, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants