How can I get the event when user type a URL and go to it?

I saw on a website that we can see when a use try to refresh the page ( using F5 or clicking the refresh button ) in this way:

if (performance.navigation.type === 1)

My question is: Let’s say the user don’t refresh the page but he type another URL to my other page. How can I get that event?

I say that because I have stored in my Redux state if user is logged in. When the page is type another URL, my state is lost. So, I want to catch that moment and check if I have a token in localstorage.