9 lines
204 B
TypeScript
9 lines
204 B
TypeScript
export default defineNuxtRouteMiddleware(() => {
|
|
const authStore = useAuthStore();
|
|
const { toLogin } = useRouteLocation();
|
|
|
|
if (!authStore.isAdmin) {
|
|
return navigateTo(toLogin()?.path);
|
|
}
|
|
});
|