From 52b970e843e529043667ff488d4aeb09d11d7ec0 Mon Sep 17 00:00:00 2001 From: Gatsik <74517072+Gatsik@users.noreply.github.com> Date: Sun, 4 Aug 2024 19:39:50 +0300 Subject: [PATCH] Make sure that redirect uri uses IPv4 address of localhost maybe it's a PyQt6-6.7.1 issue, maybe not, but running from source is fine and running from frozen may be fine and may be not -- reason is unknown (yet) --- src/oauth/oauth_flow.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/oauth/oauth_flow.py b/src/oauth/oauth_flow.py index 9710e990f..4507ef847 100644 --- a/src/oauth/oauth_flow.py +++ b/src/oauth/oauth_flow.py @@ -15,7 +15,10 @@ class OAuthReplyHandler(QOAuthHttpServerReplyHandler): def callback(self) -> str: with_trailing_slash = super().callback() # remove trailing slash because server does not accept it - return with_trailing_slash.removesuffix("/") + without_trailing_slash = with_trailing_slash.removesuffix("/") + # sometimes it's 127.0.0.1, sometimes it magically becomes 'localhost' -- + # make it deterministic + return without_trailing_slash.replace("localhost", "127.0.0.1") @with_logger