mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-12-06 21:23:05 +05:00
A device can set sensor values with `Authorization: Bearer <token>` on POST /api/sensor/value while portal authentication stays enabled, so the portal password is never given to the device. - the token is 32 random hex chars, created on first boot - it is accepted only by /api/sensor/value; Basic auth keeps working - the portal settings show it read-only, with a button to regenerate it (POST /api/portal/token/regenerate), which revokes the old one - GET /api/settings/portal and the backup include `api_token`; posting a valid token restores it The token is kept in NVS rather than in PortalSettings: adding a field to Settings changes the /settings.conf layout and would reset all settings on upgrade.