Clear active host on logout

When logging out of the active host while other hosts exist,
the stale ActiveHost reference caused DefaultHost() to silently
fall through to the first alphabetical host instead of treating
the user as logged out.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-15 12:09:35 +01:00
parent a8ac1fa2a1
commit 0438b8457d

View File

@@ -71,6 +71,9 @@ func NewCmdLogout(f *cmdutil.Factory) *cobra.Command {
}
delete(cfg.Hosts, flagHost)
if cfg.ActiveHost == flagHost {
cfg.ActiveHost = ""
}
if err := cfg.Save(); err != nil {
return err