diff --git a/modules/features/teamsbot/routeFeatureTeamsbot.py b/modules/features/teamsbot/routeFeatureTeamsbot.py index 984539f5..1d0a5cb8 100644 --- a/modules/features/teamsbot/routeFeatureTeamsbot.py +++ b/modules/features/teamsbot/routeFeatureTeamsbot.py @@ -735,9 +735,16 @@ async def testAuth( if systemBot: email = systemBot.get("email") encryptedPwd = systemBot.get("encryptedPassword") + logger.info(f"[test-auth] System bot found: email={email}, hasEncryptedPwd={bool(encryptedPwd)}") if encryptedPwd: - from modules.shared.configuration import decryptValue - password = decryptValue(encryptedPwd, userId=str(context.user.id), keyName="systemBotPassword") + try: + from modules.shared.configuration import decryptValue + password = decryptValue(encryptedPwd, userId=str(context.user.id), keyName="systemBotPassword") + logger.info(f"[test-auth] Password decrypted successfully, length={len(password) if password else 0}") + except Exception as e: + logger.error(f"[test-auth] Password decryption failed: {e}") + else: + logger.warn(f"[test-auth] No active system bot found for mandate {mandateId}") # Forward to browser bot service browserBotUrl = effectiveConfig._getEffectiveBrowserBotUrl()