This commit is contained in:
2025-09-03 16:26:31 +02:00
parent b48e04ba38
commit f8ab14cc29
2 changed files with 3 additions and 7 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
api/vendor/*

View File

@ -53,6 +53,7 @@ definePageMeta({
// This is an example of inline middleware // This is an example of inline middleware
middleware: async nuxtApp => { middleware: async nuxtApp => {
const host = useRequestURL().origin const host = useRequestURL().origin
console.log(useRequestURL())
const res = await $fetch(host + '/api/status') const res = await $fetch(host + '/api/status')
if (res.status === 'ready') { if (res.status === 'ready') {
navigateTo(host, { external: true }) navigateTo(host, { external: true })
@ -82,13 +83,6 @@ const status = ref('starting')
const POLL_MS = 5000 const POLL_MS = 5000
const ALLOWED_REDIRECTS = new Set(['/', '/login', '/signin']) const ALLOWED_REDIRECTS = new Set(['/', '/login', '/signin'])
function sanitizeRedirect(raw) {
if (typeof raw !== 'string') return '/login'
if (raw.startsWith('http://') || raw.startsWith('https://')) return '/login'
if (!raw.startsWith('/')) return '/login'
const pathOnly = raw.split('?')[0]
return ALLOWED_REDIRECTS.has(pathOnly) ? raw : '/login'
}
async function checkStatus () { async function checkStatus () {
try { try {