feat(router): prevent redirection from public landing pages on session expiration

This commit is contained in:
Torsten Schulz (local)
2026-08-28 13:37:01 +02:00
parent a89cd39473
commit 8d1b92becf
3 changed files with 11 additions and 3 deletions

View File

@@ -43,6 +43,12 @@ const router = createRouter({
});
router.beforeEach(async (to, from, next) => {
// These are public entry pages. They must never be redirected because a
// persisted login has expired while the application is starting up.
if (to.meta?.publicLanding) {
return next();
}
if (to.matched.some(record => record.meta.requiresAuth)) {
if (!store.getters.isLoggedIn) {
return next('/');