I'm learning Vue for 2 weeks now and I cannot find an answer to this question about routing security.
When I'm securing routes in Vue with the meta fields and a routing guard like in the examle I wonder what a client could do to see the components still.
const router = new VueRouter({
routes: [
{
path: '/foo',
component: Foo,
children: [
{
path: 'bar',
component: Bar,
// a meta field
meta: { requiresAuth: true }
}
]
}
]
})
router.beforeEach((to, from, next) => {
// check if authenticated by jwt from store or localstorage
})
The route /foo/bar
is protected by the beforeEach hook and the requiresAuth metafield. But all this code is on clientside (as minified version, but still there). A user could alter the code and see the component.
I know that I have to protect all the api routes on the Backend again so that the user can't get any private information. But a user could possibly see the protected component.
As I see it there is no way to hide a component from a user 100% secure?