mirror of
https://github.com/netbirdio/netbird.git
synced 2026-07-16 19:49:56 +00:00
After a successful WaitSSOLogin the daemon deliberately stays in StatusNeedsLogin, and after a mid-session expiry (peer kicked out by the management server) the engine tears down with clientRunning == false. In both cases the caller's Up takes the fresh-start branch, which only accepted StatusIdle and rejected NeedsLogin with "up already in progress: current status NeedsLogin". This forced a second Up to actually connect (CLI: re-run `netbird up`; GUI: click Connect again). Treat NeedsLogin as a legitimate fresh-start entry state and reset it to Idle before starting the engine, so the first Up after login drives Connecting -> Connected directly.