fix(webconfig): persist the admin password before completing Ethernet onboarding
The upstream `password` command saves /prefs.json without reporting the result, and WebConfig overwrites its reply with "OK". If that write failed while the later /mqtt.json write succeeded, wifi.setup_complete was set and the factory password came back after reboot with first-run setup suppressed. onInitialSetupComplete() now re-saves /prefs.json and records completion only when it succeeds; otherwise the batch fails, setup stays open, and no reboot is queued.
This commit is contained in:
1 parent
de19fccfd2
commit
eb39ca59e7
2 files changed
+4
No files matched your search
@@ -508,6 +508,8 @@ public:
|
||||
}
|
||||
void onConfigBatchEnd() override;
|
||||
bool onInitialSetupComplete() override {
|
||||
// The password command does not report its save; make it durable first.
|
||||
if (!_cli.savePrefs(_fs)) return false;
|
||||
MQTTPrefs* obs = _cli.getObserverPrefs();
|
||||
obs->network_setup_complete = 1;
|
||||
if (_cli.saveObserverPrefs(_fs)) return true;
|
||||
|
||||
@@ -498,6 +498,8 @@ public:
|
||||
}
|
||||
void onConfigBatchEnd() override;
|
||||
bool onInitialSetupComplete() override {
|
||||
// The password command does not report its save; make it durable first.
|
||||
if (!_cli.savePrefs(_fs)) return false;
|
||||
MQTTPrefs* obs = _cli.getObserverPrefs();
|
||||
obs->network_setup_complete = 1;
|
||||
if (_cli.saveObserverPrefs(_fs)) return true;
|
||||
|
||||
Reference in new issue
Block a user