session expiration / logout

This commit is contained in:
Maxime Duchêne-Savard 2026-07-30 13:54:50 -04:00
parent 604a82b7e8
commit 0eb488be2c

View File

@ -7,8 +7,16 @@
const signedIn = computed(() => Boolean(auth.token))
async function signOut () {
clearSession()
await router.push('/')
const token = auth.token
try {
await fetch('/api/signout', {
method: 'POST',
headers: { Authorization: `Bearer ${token}` },
})
} finally {
clearSession()
await router.push('/')
}
}
</script>