clear_session
Clear current authentication session and stored tokens to force a re-authentication when a fresh login is required.
Instructions
Clear the current authentication session and stored tokens. Use this if you need to force a re-authentication.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:466-478 (handler)Main tool handler for 'clear_session'. Calls client.clearSession() and configManager.clearToken(), then returns a success message.
case 'clear_session': { if (client) { await client.clearSession(); } await configManager.clearToken(); return { content: [{ type: 'text', text: 'Session cleared. You will need to re-authenticate on the next request.' }] }; } - src/index.ts:228-239 (schema)Tool schema definition for 'clear_session'. It has no input properties and is marked with destructiveHint.
{ name: 'clear_session', description: 'Clear the current authentication session and stored tokens. Use this if you need to force a re-authentication.', inputSchema: { type: 'object', properties: {}, required: [] }, annotations: { destructiveHint: true } } - src/index.ts:228-239 (registration)Tool registered in the tools array with name 'clear_session'.
{ name: 'clear_session', description: 'Clear the current authentication session and stored tokens. Use this if you need to force a re-authentication.', inputSchema: { type: 'object', properties: {}, required: [] }, annotations: { destructiveHint: true } } - src/librelink-client.ts:482-495 (helper)clearSession() method on the client. Resets JWT token, accountId, userId, patientId, and tokenExpires, then clears token via configManager.
/** * Clear stored session */ async clearSession(): Promise<void> { this.jwtToken = null; this.accountId = null; this.userId = null; this.patientId = null; this.tokenExpires = 0; if (this.configManager) { await this.configManager.clearToken(); } } - src/config.ts:270-272 (helper)ConfigManager.clearToken() delegates to secureStorage.clearToken() to remove persisted credentials.
async clearToken(): Promise<void> { await this.secureStorage.clearToken(); }