I use the story mode in vue router (to expose the URL to the user), but I need to prevent the user from manually changing it, unless accessing a URL that they have already visited (from an app redirect).
If I have the following route with id parameter:
{ path: '/user/:id', name: 'User', component: User }
If the user accesses http://example/user/1 and http://example/user/2 from the application, he could access the 2 URLS manually, but if he changes the 'id' 2 to 3 (http://example/user/3) should not be able to access.
Although vue-router limits that the content is not modified if the user changes user/2 to user/3, when the user refreshes the page with F5 with the URL http://example/user/3, they access without restrictions.
I could save a list of visited routes in the store and validate using
router.beforeEach ((to, from, next)
to verify that the route being accessed already exists in the list of visited routes, but I wanted to know if there is no functionality vue-router to solve it naturally.