From b47775019fb954fddb11690ed236532c5704e173 Mon Sep 17 00:00:00 2001 From: David Whittaker <84562015+whitdog47@users.noreply.github.com> Date: Tue, 3 Dec 2024 14:51:10 -0800 Subject: [PATCH] feat(mfa): change mfa prompt link to button (#5565) --- .../dispatch_slack/case/interactive.py | 53 +++++++++++++------ 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/src/dispatch/plugins/dispatch_slack/case/interactive.py b/src/dispatch/plugins/dispatch_slack/case/interactive.py index 15f7e3914536..5343a4b51b8c 100644 --- a/src/dispatch/plugins/dispatch_slack/case/interactive.py +++ b/src/dispatch/plugins/dispatch_slack/case/interactive.py @@ -2511,28 +2511,49 @@ def ack_mfa_required_submission_event( ) -> None: """Handles the add engagement submission event acknowledgement.""" + blocks = [] + if mfa_enabled: - mfa_text = ( - "🔐 To complete this action, you need to verify your identity through Multi-Factor Authentication (MFA).\n\n" - f"Please <{challenge_url}|*click here*> to open the MFA verification page." + blocks.extend( + [ + Section( + text="To complete this action, you need to verify your identity through Multi-Factor Authentication (MFA).\n\n" + "Please click the verify button to open the MFA verification page." + ), + Actions( + elements=[ + Button( + text="🔐 Verify", + action_id="button-link", + style="primary", + url=challenge_url, + ) + ] + ), + ] ) else: - mfa_text = "✅ No additional verification required. You can proceed with the confirmation." + blocks.append( + Section( + text="✅ No additional verification required. You can proceed with the confirmation." + ) + ) - blocks = [ - Section(text=mfa_text), - Divider(), - Context( - elements=[ - MarkdownText( - text="💡 This step protects against unauthorized confirmation if your account is compromised." - ) - ] - ), - ] + blocks.extend( + [ + Divider(), + Context( + elements=[ + MarkdownText( + text="💡 This step protects against unauthorized confirmation if your account is compromised." + ) + ] + ), + ] + ) modal = Modal( - title="Confirm Your Identity", + title="Verify Your Identity", close="Cancel", blocks=blocks, ).build()