[client] Fix session extension and SSH auth always using the device code flow on Linux - #7187
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThe change centralizes graphical-session detection in ChangesGraphical Session Authentication
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant SSH
participant UI
participant Daemon
participant OAuthFlow
CLI->>Daemon: Send JWT request with HasGraphicalSession
SSH->>Daemon: Send JWT request with HasGraphicalSession
UI->>Daemon: Send extension request with HasGraphicalSession
Daemon->>OAuthFlow: Create flow with caller-provided session state
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Release artifactsBuilt for PR head
GHCR images (amd64)
This comment is updated by the Release workflow. Artifact links expire according to the workflow retention policy. |



Describe your changes
netbird login --extendand SSH authentication always pick the device code flow on Linux, because the daemon decides which flow to use by reading its own environment. A service never inherits the user's session variables, so it always concludes there is no graphical session, and the login fails on servers where the device code flow is not available.DISPLAYandWAYLAND_DISPLAY(the same pairxdg-openchecks),BROWSER, and the session type reported by logind, in addition to the desktop variables checked beforeIssue ticket number and link
Stack
Checklist
Documentation
Select exactly one:
Flow selection is internal to the client; no configuration or user-facing option changes.
Summary by CodeRabbit
New Features
Bug Fixes
Tests