blob: 18123ae8f59227fe3521ada5d652db006e106203 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import { useSessionStore } from "@/stores/session";
export default defineNuxtRouteMiddleware((to, from) => {
const session = useSessionStore();
if (to.fullPath === '/' && session.getSessionType !== 'none') {
return navigateTo('/editor');
}
if (to.fullPath.startsWith('/editor') && session.getSessionType === 'none') {
return navigateTo('/');
}
});
|