initial commit

This commit is contained in:
Madison Grubb
2026-02-10 23:32:26 -05:00
commit b7046dc0e6
133 changed files with 26080 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
export default defineNuxtPlugin(() => {
const route = useRoute()
const baseFetch = globalThis.$fetch ?? $fetch
globalThis.$fetch = baseFetch.create({
onResponseError({ response, request }) {
if (response?.status !== 401) return
const url = typeof request === 'string' ? request : request?.url ?? ''
if (!url.startsWith('/')) return
const redirect = (route.fullPath && route.fullPath !== '/' ? route.fullPath : '/')
navigateTo({ path: '/login', query: { redirect } }, { replace: true })
},
})
})