Complete sermon itinerary application with Nuxt 3, SQLite, authentication, and Docker deployment
This commit is contained in:
9
middleware/auth.ts
Normal file
9
middleware/auth.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export default defineNuxtRouteMiddleware(async (to, from) => {
|
||||
if (import.meta.server) return
|
||||
|
||||
const { data } = await useFetch('/api/auth/verify')
|
||||
|
||||
if (!data.value?.authenticated) {
|
||||
return navigateTo('/login')
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user