mirror of
https://github.com/netbirdio/netbird.git
synced 2026-07-19 15:01:29 +02:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user