Login watcher
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user