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' credentials: 'include'
}) })
recipes.value = data recipes.value = data
const isLoggedIn = useState('isLoggedIn')
isLoggedIn.value = true
} catch (err) { } catch (err) {
console.error("Failed to load collection:", 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 { } finally {
loading.value = false loading.value = false
} }