From 0dfb697b46bde114335dcc10d7cf9e5d3744fe5b Mon Sep 17 00:00:00 2001 From: Christopher Munz-Michielin Date: Thu, 12 Mar 2026 21:28:36 -0700 Subject: [PATCH] Fix regex matches to work with new login page --- ws_api/wealthsimple_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ws_api/wealthsimple_api.py b/ws_api/wealthsimple_api.py index d79ce5d..55609c7 100644 --- a/ws_api/wealthsimple_api.py +++ b/ws_api/wealthsimple_api.py @@ -122,7 +122,7 @@ def start_session(self, sess: WSAPISession | None = None): for line in response.splitlines(): # Look for wssdi in set-cookie headers if not self.session.wssdi and "set-cookie:" in line.lower(): - match = re.search(r"wssdi=([a-f0-9]+);", line, re.IGNORECASE) + match = re.search(r"wssdi=([a-f0-9-]+);", line, re.IGNORECASE) if match: self.session.wssdi = match.group(1) @@ -149,7 +149,7 @@ def start_session(self, sess: WSAPISession | None = None): # Look for clientId in the app JS file match = re.search( - r'production:.*clientId:"([a-f0-9]+)"', response, re.IGNORECASE + r'production.*clientId:"([a-f0-9]+)"', response, re.IGNORECASE ) if match: self.session.client_id = match.group(1)