0
I am developing a PWA and I am having problems with the router, because when I use the back button of my smartphone it goes through all the previously visited routes only to after exit the application, and I want when the user uses the back button the first time, at most in the second click it closes the application.
I’ve already set up a few things on beforeEach
router:
export default (to, from, next) => {
if (//verifica se o usuario está logado, caso não, encaminha para o login) {
next('/login')
}
else {
next({replace: true})
}
}
And every time I call the router to redirect to some different page or route instead of using router.push(rota)
I’m using router.replace(rota)
I’ve checked all the places where you use the router and in all of them I’ve set up to use the replace()
instead of push()