Skip to content

[Browser MFA] Fix formatting in moderated sessions#65236

Merged
danielashare merged 1 commit into
masterfrom
danielashare/browser-mfa-terminal-formatting
Apr 1, 2026
Merged

[Browser MFA] Fix formatting in moderated sessions#65236
danielashare merged 1 commit into
masterfrom
danielashare/browser-mfa-terminal-formatting

Conversation

@danielashare
Copy link
Copy Markdown
Contributor

This PR fixes formatting when printing MFA messages to the terminal.

During an interactive SSH session, like moderated SSH sessions, tsh puts the terminal in to raw mode. In raw mode, a \n only moves the cursor down a line, not back to column 0. To fix this we have to use \r\n. This doesn't affect cooked-mode terminals.

Before change:

Teleport > Please tap your MFA key
If browser window does not open automatically, open it by clicking on the link:
                                                                                http://127.0.0.1:62258/d8c64b1f-3454-4027-b75b-bab6a0688234

Teleport > Received MFA presence confirmation

After change:

Teleport > Please tap your MFA key
If browser window does not open automatically, open it by clicking on the link:
 http://127.0.0.1:63911/5aa94a86-f4c3-4986-911a-47187a6929ad

Teleport > Received MFA presence confirmation

Manual Test Plan

Test Environment

Teleport e running locally with moderated sessions enabled.

Test Cases

  • Formatting is fixed in a moderated session (raw mode)
  • Formatting is unaffected in regular sessions (cooked mode)

@danielashare danielashare self-assigned this Mar 31, 2026
@danielashare danielashare added no-changelog Indicates that a PR does not require a changelog entry backport/branch/v18 labels Mar 31, 2026
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@danielashare
Copy link
Copy Markdown
Contributor Author

@claude review once

@danielashare danielashare force-pushed the danielashare/browser-mfa-terminal-formatting branch from 6dd05fe to afc3452 Compare March 31, 2026 20:13
Comment thread lib/client/mfa/cli_test.go
@danielashare danielashare force-pushed the danielashare/browser-mfa-terminal-formatting branch from afc3452 to 572148c Compare March 31, 2026 21:25
@danielashare danielashare added this pull request to the merge queue Apr 1, 2026
Merged via the queue into master with commit 4b9658d Apr 1, 2026
46 checks passed
@danielashare danielashare deleted the danielashare/browser-mfa-terminal-formatting branch April 1, 2026 11:29
@backport-bot-workflows
Copy link
Copy Markdown
Contributor

@danielashare See the table below for backport results.

Branch Result
branch/v18 Failed

danielashare added a commit that referenced this pull request May 6, 2026
[Browser MFA] Add protobuf and config (#63831)

[Browser MFA] Add proto for Browser MFA feature (#64048)

[Browser MFA] Add CompleteBrowserMFAChallenge gRPC (#63873)

[Browser MFA] Rename browser mfa config name (#64980)

[Browser MFA] Add BrowserMFARequestID to CreateAuthenticateChallenge (#63945)

[Browser MFA] Add Browser MFA to challenge request flow (#63936)

[Browser MFA] Add initial requests for browser MFA process to client tools (#64301)

[Browser MFA] Add tsh callback handling for webauthn response (#64461)

[Browser MFA] Add Browser MFA to presence checks (#65052)

[Browser MFA] Add browser MFA path to MFA finish flow (#64523)

[Browser MFA] Add Browser MFA to Connect (#64887)

[Browser MFA] Add Browser MFA UI (#64692)

[Browser MFA] Fix formatting in moderated sessions (#65236)

[Browser MFA] Add Browser MFA ceremony tests
ivan-bax pushed a commit to ivan-bax/teleport that referenced this pull request May 22, 2026
[Browser MFA] Add protobuf and config (gravitational#63831)

[Browser MFA] Add proto for Browser MFA feature (gravitational#64048)

[Browser MFA] Add CompleteBrowserMFAChallenge gRPC (gravitational#63873)

[Browser MFA] Rename browser mfa config name (gravitational#64980)

[Browser MFA] Add BrowserMFARequestID to CreateAuthenticateChallenge (gravitational#63945)

[Browser MFA] Add Browser MFA to challenge request flow (gravitational#63936)

[Browser MFA] Add initial requests for browser MFA process to client tools (gravitational#64301)

[Browser MFA] Add tsh callback handling for webauthn response (gravitational#64461)

[Browser MFA] Add Browser MFA to presence checks (gravitational#65052)

[Browser MFA] Add browser MFA path to MFA finish flow (gravitational#64523)

[Browser MFA] Add Browser MFA to Connect (gravitational#64887)

[Browser MFA] Add Browser MFA UI (gravitational#64692)

[Browser MFA] Fix formatting in moderated sessions (gravitational#65236)

[Browser MFA] Add Browser MFA ceremony tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/branch/v18 no-changelog Indicates that a PR does not require a changelog entry size/sm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants