Fix full page reload after login - #5837
Merged
norman-abramovitz merged 1 commit intoAug 23, 2026
Merged
Conversation
After a successful login the console rendered /home, blanked the whole app, and re-rendered. handleSuccessfulLogin ran twice — the click handler and the existing-session auto-redirect both fire on the same logged-in+valid state — so two concurrent router.navigate(['/home']) calls collided; the router cancelled one (resolving false), which fell through to the window.location.href fallback and forced a full document reload. Guard the redirect so it runs once; the fallback then only fires on a genuine navigation failure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After a successful login the console rendered
/home, blanked the whole app, and re-rendered — a visible full page reload on every sign-in.Cause
handleSuccessfulLoginran twice for the same login: the click handler and thengOnInitexisting-session auto-redirect both fire when auth becomes "logged in + valid", so two concurrentrouter.navigate(['/home'])calls collide. WithonSameUrlNavigation: 'reload'the router cancels one, which resolvesfalseand drops into thewindow.location.hreffallback — a full document reload. A HAR of the login confirmed a single script-initiateddocumentGET /home(an in-app router navigation issues no document request).Fix
Guard
handleSuccessfulLoginso the redirect runs once. With one navigation nothing is cancelled,navResultistrue, the fallback never fires, and/homerenders a single time. Thewindow.location.hreffallback still covers a genuine navigation failure.Includes a regression test asserting a single
router.navigatewhen both triggers fire.