Skip to content

fix(logout): Redirect to email first if user is at settings but not valid session#19371

Merged
vbudhram merged 1 commit intomainfrom
fxa-12309
Sep 3, 2025
Merged

fix(logout): Redirect to email first if user is at settings but not valid session#19371
vbudhram merged 1 commit intomainfrom
fxa-12309

Conversation

@vbudhram
Copy link
Copy Markdown
Contributor

Because

  • We currently show the "General application error" message when user is in settings page but the underlying session token becomes invalid
  • I suspect its how the pages are being lazy loaded, we did have logic to do this redirect but

This pull request

  • Does a simple redirect if user is not signed in

Issue that this pull request solves

Closes: https://mozilla-hub.atlassian.net/browse/FXA-12309

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).

Other information (Optional)

There is probably a better way to do this and we should try to find the actual reason why its failing.

@vbudhram vbudhram self-assigned this Aug 29, 2025
@vbudhram vbudhram requested a review from a team as a code owner August 29, 2025 14:23
}

// If we're on settings route but user is not signed in, redirect immediately
if (window.location.pathname?.includes('/settings') && !isSignedIn) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks fine. But I was half expecting isSignedIn to be incorrect given the nature of teh bug.

Copy link
Copy Markdown
Contributor

@chenba chenba left a comment

Choose a reason for hiding this comment

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

Thanks. Please squash the commits.

@vbudhram vbudhram merged commit dd92f32 into main Sep 3, 2025
19 checks passed
@vbudhram vbudhram deleted the fxa-12309 branch September 3, 2025 16:15
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