Any idea how to redirect a page to login page based on its url when its refreshed
<p>I'm trying to redirect my page to login page when user tries to refresh the home screen, but if I add this code, the login page is redirecting to login page itself. Any idea how deal with this issue?</p>

<p>If I directly put window.location in index.html it works fine, but it works all the random url too (eg: /abcd, /asjda)</p>

<pre><code>if(window.location.pathname == /home){
    window.location = '/login';
}
</code></pre>