prampec / IotWebConf

ESP8266/ESP32 non-blocking WiFi/AP web configuration Arduino library
MIT License
530 stars 140 forks source link

show custom page after form saved #256

Open paszin opened 2 years ago

paszin commented 2 years ago

I use IoTWebConf to provide a customized onboarding experience. Therefore I rely on HTMLFormatProvider. I noticed that HTMLFormatProvider provides a function getFormSaved() (https://github.com/prampec/IotWebConf/blob/master/src/IotWebConf.h#L93) but this function is never called.

I made some modifications to use this function. Git Diff: https://github.com/paszin/IotWebConf/commit/b01f13c0c59342c49c4341cf209164c2d26a178f

I removed the cases of an empty AP password, empty wifi password, and the check whether the state is "notConfigured". Would it be better to provide custom messages for each scenario? (I don't have to cover these cases in my scenarios.)

I would submit a PR after clarifying the open questions.

mcsarge commented 1 year ago

I would like to + up this issue. In the code, getFormSaved() is never used, so overriding it does nothing. I would like to add another link to go to my custom page after the configuration is saved and to do this I assume that I should overide this method.