I'm building an Ionic 4 Angular App. In my app I have three routes /login, /createAccount and /home. In the /login route if login is successful it navigates to /home like this:
this._router.navigate(['/home'], { replaceUrl: true });
So the user can't go back to /login from /home using browser or Android back button. From /login it can also navigate normally to /createAccount so the user can return to /login using the back button. In /createAccount if account creation is successful it navigates to /home using again:
this._router.navigate(['/home'], { replaceUrl: true });
The problem is that when it navigates from /createAccount to /home the back button takes the user back to /login since it is in the navigation history. I need a way to reset the router after navigating to /home from /createAccount so the user won't return to /login from /home using browser or Android back button.