pop progress on redirect

This commit is contained in:
2023-02-26 11:35:41 +10:00
parent 7c897a7e12
commit 05cc7767bf

View File

@@ -450,11 +450,8 @@ router.beforeEach(async (to, from, next) => {
.forEach((tag) => document.head.appendChild(tag));
}
// Middleware
// if (to.meta.middleware == 'guest' && userStore.id) {
// next({ name: 'home'})
// } else
if (to.meta.middleware == "authenticated" && !userStore.id) {
progresses.pop()?.finish();
next({ name: "login", query: { redirect: to.fullPath } });
} else {
next();