From 496f0e09afe7e863cf1bcce948d48bf591086274 Mon Sep 17 00:00:00 2001 From: qwint Date: Thu, 25 Jul 2024 01:21:51 -0500 Subject: [PATCH] CommonClient: forget password when disconnecting (#3641) * makes the kivy connect button do the same username forgetting that /connect does to fix an issue where losing connection would make you unable to connect to a different server * extract duplicate code * per request, adds handling on any disconnect to forget the saved password as to not leak it to other servers --------- Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> --- CommonClient.py | 2 ++ kvui.py | 1 + 2 files changed, 3 insertions(+) diff --git a/CommonClient.py b/CommonClient.py index f8d1fcb7..09937e4b 100644 --- a/CommonClient.py +++ b/CommonClient.py @@ -61,6 +61,7 @@ class ClientCommandProcessor(CommandProcessor): if address: self.ctx.server_address = None self.ctx.username = None + self.ctx.password = None elif not self.ctx.server_address: self.output("Please specify an address.") return False @@ -514,6 +515,7 @@ class CommonContext: async def shutdown(self): self.server_address = "" self.username = None + self.password = None self.cancel_autoreconnect() if self.server and not self.server.socket.closed: await self.server.socket.close() diff --git a/kvui.py b/kvui.py index a63d6369..f83590a8 100644 --- a/kvui.py +++ b/kvui.py @@ -596,6 +596,7 @@ class GameManager(App): def connect_button_action(self, button): self.ctx.username = None + self.ctx.password = None if self.ctx.server: async_start(self.ctx.disconnect()) else: