Ionic window reload

Hello there,
i have an ionic app that check if the user logged or not everytime the page reload or refresh bu when ever i refresh it if the user is authenticated it takes me to the home page aka(http://localhost:8100/#/) but what i want is to stay in the current page aka (http://localhost:8100/#/somepage)

will you share your code sample for better understanding your situation

Mostly people are doing like they store a Boolean value in a local storage and when user open a app, It will run and check the condition is value available in local storage or not. If it available or true it will go to home else go to login page.