fixed theme picker. Added basic login
This commit is contained in:
13
web/middleware/auth.global.ts
Normal file
13
web/middleware/auth.global.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export default defineNuxtRouteMiddleware((to, _) => {
|
||||
const auth = useAuth()
|
||||
|
||||
if (to.path === '/login') {
|
||||
return
|
||||
}
|
||||
|
||||
if (auth.userId.value === null) {
|
||||
return navigateTo('/login')
|
||||
} else if (to.path !== '/') {
|
||||
return navigateTo('/')
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user