From 8786938cca68547260bf2f2b1a035a0aa794deff Mon Sep 17 00:00:00 2001 From: Jacob Schlecht Date: Sat, 23 May 2026 11:23:01 -0600 Subject: [PATCH 1/2] feat: Add a logout function for disposal of the client Signed-off-by: Jacob Schlecht --- src/Client.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Client.ts b/src/Client.ts index 3119525c..635940d6 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -395,6 +395,18 @@ export class Client extends AsyncEventEmitter { this.connect(); } + /** + * Log out of current session + * + * This funciton prepares the client for disposal by removing all event listeners and killing the events socket. + */ + async logout(): Promise { + await this.api.post("/auth/session/logout"); + this.events.removeAllListeners(); + this.removeAllListeners(); + this.events.disconnect(); + } + /** * Prepare a markdown-based message to be displayed to the user as plain text. * @param source Source markdown text From d89d090ca248f736a04641ca2f7282b99b74a831 Mon Sep 17 00:00:00 2001 From: Jacob Schlecht Date: Sat, 23 May 2026 12:52:13 -0600 Subject: [PATCH 2/2] fix: typo Signed-off-by: Jacob Schlecht --- src/Client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client.ts b/src/Client.ts index 635940d6..6782c702 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -398,7 +398,7 @@ export class Client extends AsyncEventEmitter { /** * Log out of current session * - * This funciton prepares the client for disposal by removing all event listeners and killing the events socket. + * This function prepares the client for disposal by removing all event listeners and killing the events socket. */ async logout(): Promise { await this.api.post("/auth/session/logout");