fix(ios): preserve profile name when saving config during auth

NewAuth built a fresh in-memory config from only the management URL, so
the SSO/setup-key save (DirectWriteOutConfig) overwrote the profile config
file the profile manager had just written, wiping the display name to ""
and forcing the UI to fall back to the profile ID. Load the existing config
when present and override only the management URL, keeping the name and keys.
This commit is contained in:
Zoltan Papp
2026-06-24 01:53:32 +02:00
parent 61cd545177
commit 39d189b213

View File

@@ -51,6 +51,12 @@ func NewAuth(cfgPath string, mgmURL string) (*Auth, error) {
return nil, err
}
// Preserve the existing profile config (name, keys) and override only the management URL.
if existing, err := profilemanager.GetConfig(cfgPath); err == nil {
existing.ManagementURL = cfg.ManagementURL
cfg = existing
}
return &Auth{
ctx: context.Background(),
config: cfg,