8000 set signInLink to empty when OAuthAppCredentials is set (#862) (#863) · il-null-yuyi/botbuilder-python@083f76e · GitHub
[go: up one dir, main page]

Skip to content

Commit 083f76e

Browse files
authored
set signInLink to empty when OAuthAppCredentials is set (microsoft#862) (microsoft#863)
1 parent 5ea1a8e commit 083f76e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

libraries/botbuilder-dialogs/botbuilder/dialogs/prompts/oauth_prompt.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,18 @@ async def _send_oauth_card(
311311
link = sign_in_resource.sign_in_link
312312
bot_identity: ClaimsIdentity = context.turn_state.get("BotIdentity")
313313

314+
# use the SignInLink when
315+
# in speech channel or
316+
# bot is a skill or
317+
# an extra OAuthAppCredentials is being passed in
314318
if (
315-
bot_identity and SkillValidation.is_skill_claim(bot_identity.claims)
316-
) or not context.activity.service_url.startswith("http"):
319+
(
320+
bot_identity
321+
and SkillValidation.is_skill_claim(bot_identity.claims)
322+
)
323+
or not context.activity.service_url.startswith("http")
324+
or self._settings.oath_app_credentials
325+
):
317326
if context.activity.channel_id == Channels.emulator:
318327
card_action_type = ActionTypes.open_url
319328
else:

0 commit comments

Comments
 (0)
0