mirror of
https://github.com/netbirdio/netbird.git
synced 2026-07-16 11:39:57 +00:00
WaitSSOLogin set StatusConnecting on entry and ran the browser wait on rootCtx. If the client that drove the login went away mid-wait (UI restart, CLI Ctrl+C), the wait orphaned on rootCtx until the OAuth device-code window expired, and the daemon stayed stuck reporting Connecting — a reattaching client saw a spinner that never resolved instead of a login prompt. Hold StatusNeedsLogin for the whole browser wait (also in the Login cached-flow path) so any client attaching mid-wait reads 'login required', and bridge the wait to callerCtx so a departing client cancels it. On that cancel the defer leaves NeedsLogin in place, so the next client shows the login affordance instead of a stale Connecting.