mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-30 18:49:08 +02:00
ui: auto-trigger browser login when profile switch lands on NeedsLogin
Add a second, longer-lived switchLoginWatch flag alongside switchInProgress in DaemonFeed. Suppression still clears on the first Connecting push from the new Up, but the login watcher survives past it to catch the eventual NeedsLogin / LoginFailed / SessionExpired terminal and emit EventTriggerLogin, so the React orchestrator opens the browser-login flow without a second Connect click. shouldSuppress becomes consumeForSwitch, returning both the suppress and triggerLogin signals. CancelProfileSwitch disarms the watch so an aborted switch does not pop a login window.
This commit is contained in:
@@ -125,6 +125,12 @@ type Tray struct {
|
||||
// SSO-tracked and has no cached token; applyStatus consumes this
|
||||
// flag on that transition to automatically open the browser-login
|
||||
// flow, saving the user a second Connect click.
|
||||
//
|
||||
// Profile-switch reconnects (which also fire an Up) are handled
|
||||
// centrally by DaemonFeed.statusStreamLoop — see DaemonFeed's
|
||||
// switchInProgress transitions and its EventTriggerLogin emit, so
|
||||
// that the React UI's profile dropdown gets the same auto-handoff
|
||||
// without going through this tray flag.
|
||||
pendingConnectLogin bool
|
||||
|
||||
// sessionMu guards the cached SSO deadline used by the "Session: 47m"
|
||||
|
||||
Reference in New Issue
Block a user