diff --git a/omramin.py b/omramin.py index 1a059fa..7c16161 100755 --- a/omramin.py +++ b/omramin.py @@ -291,6 +291,9 @@ def get_mfa() -> str: L.debug(f"Attempting Garmin login using cached tokens for {email}") gc.login(tokenstore=tokendata) L.debug(f"Garmin login successful using cached tokens for {email}") + + # Save tokens back to keyring in case they were proactively refreshed during login + save_service_tokens(config_path, "garmin", email, gc.client.dumps()) except (FileNotFoundError, binascii.Error, KeyError, GC.GarminConnectAuthenticationError): # Precedence: env > config > prompt