Browser History
Oldest at top, newest at bottom
1
/Home
2
/loginLogin
Back: YesForward: No
Chapter 1: The Basics
What's happening
Lotl logs into their bank to check something, but immediately forgets what! They need to press Back to return to the Home page where they saw the reminder. Help them get back!
The problem
If the redirect uses push, the login page stays in history. Back shows a useless login form instead of Home.
Your mission
Fix the navigation so pressing Back makes sense. Back should lead to /
Fix the code:
// User just logged in successfully navigate('/dashboard', { replace: });