Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mfa): change mfa prompt link to button #5565

Merged
merged 1 commit into from
Dec 3, 2024
Merged
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
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
Loading