minor: heavily simplify server and app content. unify styling (#4)
All checks were successful
ci/woodpecker/push/push Pipeline was successful
All checks were successful
ci/woodpecker/push/push Pipeline was successful
Co-authored-by: Madison Grubb <madison@elastiflow.com> Reviewed-on: #4
This commit was merged in pull request #4.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
/** Wraps $fetch to redirect to /login on 401 for same-origin requests. */
|
||||
export default defineNuxtPlugin(() => {
|
||||
const route = useRoute()
|
||||
const baseFetch = globalThis.$fetch ?? $fetch
|
||||
@@ -6,8 +7,7 @@ export default defineNuxtPlugin(() => {
|
||||
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 })
|
||||
navigateTo({ path: '/login', query: { redirect: route.fullPath || '/' } }, { replace: true })
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user