swit-oauth-logout
Logout from OAuth authentication to delete stored tokens and re-authenticate with Swit MCP Server for secure access to Swit collaboration tools.
Instructions
Logout from OAuth authentication and delete stored tokens. Use when re-authentication is required.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/handlers/oauth.handlers.ts:47-60 (handler)The main handler function for the swit-oauth-logout tool. It checks if the OAuthWebServer is available and calls logout() on its OAuthManager, returning success or error messages.export const handleOAuthLogout = async (oauthWebServer: OAuthWebServer | null) => { if (!oauthWebServer) { return { error: 'OAuth web server is not available. Cannot perform logout.', }; } oauthWebServer.getOAuthManager().logout(); return { message: 'OAuth logout completed successfully.', note: 'Cached tokens have been cleared. Use swit-oauth-start to re-authenticate.', }; };
- src/tools/oauth.tools.ts:17-21 (schema)Tool schema definition specifying the name, description, and empty input schema (no parameters required).{ name: 'swit-oauth-logout', description: 'Logout from OAuth authentication and delete stored tokens. Use when re-authentication is required.', inputSchema: zodToJsonSchema(EmptySchema), },
- src/handlers/oauth.handlers.ts:62-66 (registration)Local registration of the swit-oauth-logout tool within the oauthHandlers object, mapping the tool name to its handler function. This object is later spread into the global toolHandlers in src/index.ts.export const oauthHandlers = (oauthWebServer: OAuthWebServer | null) => ({ 'swit-oauth-status': () => handleOAuthStatus(oauthWebServer), 'swit-oauth-start': () => handleOAuthStart(oauthWebServer), 'swit-oauth-logout': () => handleOAuthLogout(oauthWebServer), });
- src/oauth-manager.ts:131-135 (helper)The OAuthManager.logout() method called by the tool handler, which clears the in-memory token information and the persistent token cache.logout(): void { this.tokenInfo = null; this.tokenCache.clear(); console.error('OAuth logout completed'); }