Login watcher

This commit is contained in:
2025-10-06 17:14:54 -04:00
parent a50791e74c
commit 291b6743c5
2 changed files with 20 additions and 3 deletions

View File

@@ -230,4 +230,12 @@ async function handleLogout() {
await $fetch('/api/auth/logout', { method: 'POST' })
window.location.reload()
}
// Watch for authentication changes (e.g., if user is deleted)
watch(() => authData.value?.authenticated, (newAuth, oldAuth) => {
// If user was authenticated but now isn't (and it's not initial load)
if (oldAuth === true && newAuth === false) {
window.location.reload()
}
})
</script>