( instanceUrl: string, knowledgeBase: string, token: string, resolvedIP: string )
| 67 | * not thrown. |
| 68 | */ |
| 69 | export async function agiloftLogoutPinned( |
| 70 | instanceUrl: string, |
| 71 | knowledgeBase: string, |
| 72 | token: string, |
| 73 | resolvedIP: string |
| 74 | ): Promise<void> { |
| 75 | try { |
| 76 | const base = instanceUrl.replace(/\/$/, '') |
| 77 | const kb = encodeURIComponent(knowledgeBase) |
| 78 | await secureFetchWithPinnedIP(`${base}/ewws/EWLogout?$KB=${kb}`, resolvedIP, { |
| 79 | method: 'POST', |
| 80 | headers: { Authorization: `Bearer ${token}` }, |
| 81 | }) |
| 82 | } catch (error) { |
| 83 | logger.warn('Agiloft logout failed (best-effort)', { error }) |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Shared wrapper that handles the full Agiloft auth lifecycle behind the |
no test coverage detected