auth middlewares
This commit is contained in:
9
frontend/middleware/not-authenticated.ts
Normal file
9
frontend/middleware/not-authenticated.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export default defineNuxtRouteMiddleware((to, _from) => {
|
||||
if (useAuthSession().value == null && to.name !== 'index') {
|
||||
return;
|
||||
}
|
||||
|
||||
return navigateTo({
|
||||
path: '/',
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user