Skip to content

Commit

Permalink
feat(mfa): change mfa prompt link to button (#5565)
Browse files Browse the repository at this point in the history
  • Loading branch information
whitdog47 authored Dec 3, 2024
1 parent 7bc0a67 commit b477750
Showing 1 changed file with 37 additions and 16 deletions.
53 changes: 37 additions & 16 deletions src/dispatch/plugins/dispatch_slack/case/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b477750

Please sign in to comment.