session timeout fix
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user