when I load my ionic application I check whether or not the user is authenticated or not. If they are I set the root page to the home page but if they are not I set the root page to the login page. My issue is when I am currently on another page so the url would look like this: http://localhost:8102/#/nav/n4/location-select
then I refresh the page my root page gets set back to the home page and I do not stay on the page I was currently on. Is there a way to make it so when I refresh the page I do not automatically go to the home page but stay on the current page I am on? Thanks for the help!
this.afAuth.authState.take(1).subscribe(auth => {
if (auth)
this.rootPage = "home";
else
this.rootPage = "LoginPage";
});