From 0438b8457d5d0bfaa4e9fe297153b56049111e93 Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Sun, 15 Mar 2026 12:09:35 +0100 Subject: [PATCH] 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 --- pkg/cmd/auth/logout/logout.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/cmd/auth/logout/logout.go b/pkg/cmd/auth/logout/logout.go index 202982811..34a76ad8d 100644 --- a/pkg/cmd/auth/logout/logout.go +++ b/pkg/cmd/auth/logout/logout.go @@ -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