import { CLEAR_REFRESH_SESSION_HEADER, CLEAR_REFRESH_SESSION_PATH } from '@/lib/refreshSessionCookie' const CLEAR_SESSION_TIMEOUT_MS = 2500 /** Same-origin cookie expiry. Must run even when Nest logout failed. */ export const expireRefreshSessionOnThisOrigin = async (): Promise => { try { await fetch(CLEAR_REFRESH_SESSION_PATH, { method: 'POST', credentials: 'same-origin', headers: { [CLEAR_REFRESH_SESSION_HEADER]: '1' }, cache: 'no-store', signal: AbortSignal.timeout(CLEAR_SESSION_TIMEOUT_MS), }) } catch { // Local storage is still wiped by AuthContext; this is cookie best-effort. } }