A navigation guard is a function run by Vue Router before or after a route change, for example beforeEach. It can allow, redirect or cancel the navigation. It is used to protect private pages depending on login state, on the interface side (the API must also control access).
Example
router.beforeEach((to) => {
if (to.meta.prive && !connecte()) return '/connexion'
})