ayushsharma82 / NetWizard

No need to hard-code WiFi credentials ever again. (ESP32, RP2040+W)
https://netwizard.pro
GNU Affero General Public License v3.0
44 stars 6 forks source link

Feature Request: Redirect to default page when Portal is closed #16

Closed robbse81 closed 1 month ago

robbse81 commented 1 month ago

Once the portal has connected to an Station, the portal is closed. Now, when you try to reach your device you get presented a HTTP Error 500. It would be helpful to redirect in this case e.g. to the dashbaord.

robbse81 commented 1 month ago

Solved.

Simply add

server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
  request->redirect("/dashboard");
}).setFilter(ON_STA_FILTER);

before

server.begin();