With functions like this, how do redirect the user to the previous page after a successful login
const router = createRouter({
history: createWebHashHistory(),
routes,
});
router.beforeEach(() => {
// reset config to initial state
store.commit(Mutations.RESET_LAYOUT_CONFIG);
store.dispatch(Actions.VERIFY_AUTH, { access_token: JwtService.getToken() });
// Scroll page to top on every route change
setTimeout(() => {
window.scrollTo(0, 0);
}, 100);
});
Unfortunately, at the moment it is not implemented by default.
You can check comment below to achieve this:
https://stackoverflow.com/a/48271996/13267518