logout
Clear local authentication credentials to securely end your PingCode session and protect account access.
Instructions
退出 PingCode 登录,清除本地保存的凭证。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/login.ts:167-173 (handler)The core handler function for the 'logout' tool. It calls clearCredentials() to remove saved login credentials and returns a success message.export function logout(): { success: boolean; message: string } { clearCredentials(); return { success: true, message: '已退出登录,凭证已清除', }; }
- src/index.ts:40-48 (schema)The input schema definition for the 'logout' tool in the ListTools response. It specifies no required input parameters.{ name: 'logout', description: '退出 PingCode 登录,清除本地保存的凭证。', inputSchema: { type: 'object', properties: {}, required: [], }, },
- src/index.ts:179-190 (registration)The registration and dispatch logic in the CallToolRequestSchema handler that invokes the logout() function when the tool is called.case 'logout': { const result = logout(); return { content: [ { type: 'text', text: result.message, }, ], isError: !result.success, }; }
- src/utils/credentials.js:49-58 (helper)Supporting helper function that implements the credential clearing logic by deleting the credentials.json file.function clearCredentials() { try { if (fs.existsSync(CREDENTIALS_FILE)) { fs.unlinkSync(CREDENTIALS_FILE); } } catch (_a) { // ignore } }