title: Vue Router Redirect to Login page
body: <p>I am trying to test my Vue.js app authentication.</p>
  
  <p>Assume, a user log in and to go to his profile the link would look like this.
  <a href="https://website.com/profile/1" rel="nofollow noreferrer">https://website.com/profile/1</a></p>
  
  <p>He can get to his page but what if he is a hacker and if he tried to type</p>
  
  <p><a href="https://website.com/profile/2" rel="nofollow noreferrer">https://website.com/profile/2</a></p>
  
  <p>which will go to the profile of another person.</p>
  
  <p>How can I redirect this hacker to the login page if he tried to go to a URL that does not belong to his profile?</p>
  
  <p>Right now, I can stop him from viewing another people profile but still, he is still in the profile link even if he typed</p>
  
  <p><a href="https://website.com/profile/2" rel="nofollow noreferrer">https://website.com/profile/2</a></p>
  
  <p>What I am trying to accomplish is that if users type a link that does not belong to his or her but which is valuable to other people it will redirect to the login page. </p>
  
  <p>I am not storing User Data on the client side. </p>