Skip to content

Commit b94e4e7

Browse files
authored
Handler config fix (#77) (#78)
1 parent 821e48f commit b94e4e7

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/agent_application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ async def _on_error(self, context: TurnContext, err: ApplicationError) -> None:
799799
)
800800
return await self._error(context, err)
801801

802-
ogger.error(
802+
logger.error(
803803
f"An error occurred in the AgentApplication: {err}",
804804
exc_info=True,
805805
)

libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/oauth/authorization.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,19 +124,16 @@ def __init__(
124124
else auth_configuration.get("AUTOSIGNIN", False)
125125
)
126126

127-
if not auth_handlers:
128-
handlers_congif: Dict[str, Dict] = auth_configuration.get("HANDLERS")
129-
if not handlers_congif:
130-
logger.error("No auth handlers provided in configuration")
131-
raise ValueError("The authorization does not have any auth handlers")
127+
handlers_config: Dict[str, Dict] = auth_configuration.get("HANDLERS")
128+
if not auth_handlers and handlers_config:
132129
auth_handlers = {
133130
handler_name: AuthHandler(
134131
name=handler_name, **config.get("SETTINGS", {})
135132
)
136-
for handler_name, config in handlers_congif.items()
133+
for handler_name, config in handlers_config.items()
137134
}
138135

139-
self._auth_handlers = auth_handlers
136+
self._auth_handlers = auth_handlers or {}
140137
self._sign_in_handler: Optional[
141138
Callable[[TurnContext, TurnState, Optional[str]], Awaitable[None]]
142139
] = None

0 commit comments

Comments
 (0)