fix: load system bot credentials only when joinMode is SYSTEM_BOT (anonymous join fix)

Made-with: Cursor
This commit is contained in:
patrick-motsch 2026-02-28 15:53:31 +01:00
parent 1dd354794b
commit 65a8026496

View file

@ -202,9 +202,9 @@ async def startSession(
botAccountPassword = None
# System bot access: only SysAdmin can use the system bot account.
# Non-SysAdmin users are forced to anonymous join to prevent concurrent
# access conflicts (a Microsoft account can only be in one meeting at a time).
if context.isSysAdmin:
# Credentials are loaded only when joinMode explicitly requests SYSTEM_BOT.
# When joinMode is ANONYMOUS, the bot joins without auth regardless of SysAdmin.
if context.isSysAdmin and joinMode == TeamsbotJoinMode.SYSTEM_BOT:
systemBot = interface.getActiveSystemBot(mandateId)
if not systemBot:
from .datamodelTeamsbot import TeamsbotSystemBot