I'm developing a PWA and I'm having problems with the router, because when I use the back button on my smartphone it goes through all the routes I've visited previously and only after leaving the application, and I want it when the user uses the go back the first time, at most in the second click it close the application.
I have already configured some things in the beforeEach
of the 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 have already checked all the places where you use the router and in all of them I configured to use replace()
instead of push()