import { clearSharedDesktopAuthSession, readSharedDesktopAuthSession, } from '../../src/auth/shared-session' export async function runLogout() { const current = readSharedDesktopAuthSession() if (!current?.token) { console.log(' not signed in') return } try { await fetch(`${current.origin.replace(/\/$/, '')}/api/auth/sign-out`, { method: 'POST', headers: { authorization: `Bearer ${current.token}` }, }) } catch { // best-effort only } clearSharedDesktopAuthSession() console.log(' signed out') }