I am trying to prevent users from manually changing url in the browser. If they try to manually change the url I have to redirect them back to the previous page. i.e. if the url is localhost:8000/home-view and if they try to change it manually by removing “-view” to localhost:8000/home, I should be redirecting them back to localhost:8000/home-view. I am using typescript , vue-class-component.
So I did the following :-
- Registered the hooks.
- In the code.
Unfortunately this is not working for manual change in URL’s . Programatically if I add a button which on click does a router push to a different page, this route guards is triggering. But not in the case of manual changes. Am I missing something?