diff --git a/wrapper.py b/wrapper.py index 1a26537..e07a452 100755 --- a/wrapper.py +++ b/wrapper.py @@ -224,7 +224,7 @@ def detect_launch_command(): return commands -def get_secret(config, config_path): +def get_secret(config, config_path, allow_prompt=True): """ Retrieves the OTP secret in the following priority: 1. System Keyring (SERVICE_NAME, USERNAME) - if available @@ -266,6 +266,9 @@ def get_secret(config, config_path): # No keyring, just use config return secret + if not allow_prompt: + return None + # 3. Prompt User if HAS_KEYRING: print("\nOTP Secret not found in keyring.")