session timeout fix

This commit is contained in:
2026-03-19 21:18:36 +00:00
parent 1964c0ae70
commit b5b1999fa2

View File

@@ -328,9 +328,15 @@ const fetchRecipes = async () => {
credentials: 'include'
})
recipes.value = data
const isLoggedIn = useState('isLoggedIn')
isLoggedIn.value = true
} catch (err) {
console.error("Failed to load collection:", err)
if (err.status === 401) navigateTo('/login')
if (err.status === 401) {
const isLoggedIn = useState('isLoggedIn')
isLoggedIn.value = false
navigateTo('/login')
}
} finally {
loading.value = false
}