Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/apps/scripts/generate_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def {method_name}(self, handler: Optional[{handler_type}] = None) -> {union_type
def decorator(func: {handler_type}) -> {handler_type}:
validate_handler_type(func, {input_class_name}, "{method_name}", "{input_class_name}")
config = ACTIVITY_ROUTES["{config_key}"]
self.router.add_handler(config.selector, func)
self.router.add_handler(config.selector, func, route_name=config.name)
return func

if handler is not None:
Expand Down
15 changes: 13 additions & 2 deletions packages/apps/src/microsoft_teams/apps/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
from .plugins import PluginBase, PluginStartEvent
from .routing import ActivityHandlerMixin, ActivityRouter
from .routing.activity_context import ActivityContext
from .routing.activity_route_configs import ACTIVITY_ROUTES
from .token_manager import TokenManager
from .utils import create_graph_client
from .utils.thread import to_threaded_conversation_id
Expand Down Expand Up @@ -156,8 +157,18 @@ def __init__(self, **options: Unpack[AppOptions]):
default_connection_name=self.options.default_connection_name,
event_emitter=self._events,
)
self.on_signin_token_exchange(oauth_handlers.sign_in_token_exchange)
self.on_signin_verify_state(oauth_handlers.sign_in_verify_state)
self.router.add_handler(
ACTIVITY_ROUTES["signin.token-exchange"].selector,
oauth_handlers.sign_in_token_exchange,
route_name=ACTIVITY_ROUTES["signin.token-exchange"].name,
route_type="system",
)
self.router.add_handler(
ACTIVITY_ROUTES["signin.verify-state"].selector,
oauth_handlers.sign_in_verify_state,
route_name=ACTIVITY_ROUTES["signin.verify-state"].name,
route_type="system",
)
self.on_signin_failure(oauth_handlers.sign_in_failure)

self.entra_token_validator: Optional[TokenValidator] = None
Expand Down
Loading