From 98f811cf7ce4ffa3dc11eacada9d57e005cb109a Mon Sep 17 00:00:00 2001 From: Meir Miyara <3089864+mase1981@users.noreply.github.com> Date: Sat, 14 Feb 2026 09:53:24 -0600 Subject: [PATCH] Fix: Use refresh token auth when refresh_token is explicitly provided When a refresh_token is passed to LGHorizonAuth(), use refresh token authentication regardless of the country's use_refreshtoken setting. The country setting should only determine the initial auth method. If a refresh token exists from a previous auth, it should be used. --- lghorizon/lghorizon_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lghorizon/lghorizon_models.py b/lghorizon/lghorizon_models.py index 04d8941..ec7135b 100644 --- a/lghorizon/lghorizon_models.py +++ b/lghorizon/lghorizon_models.py @@ -504,7 +504,7 @@ def __init__( self._token_expiry = None self._country_code = country_code self._host = COUNTRY_SETTINGS[country_code]["api_url"] - self._use_refresh_token = COUNTRY_SETTINGS[country_code]["use_refreshtoken"] + self._use_refresh_token = COUNTRY_SETTINGS[country_code]["use_refreshtoken"] or bool(refresh_token) self._service_config = None self._token_refresh_callback = token_refresh_callback