Fetch MQTT credentials from plant's own settings integration

Was reading the shared central mqtt integration, which meant plant
silently authenticated as whichever app's credentials were pasted
there (no plant/# ACL on any of them, so no telemetry ever arrived).
Now reads mqtt_plant instead, its own dedicated slug.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-07-28 22:46:52 +00:00
parent 9245abc6eb
commit 251c3ead59

View file

@ -21,7 +21,7 @@ let prefixMap = [] // [{ prefix, assetId }], longest prefix first so overlapping
let subscribedTopics = new Set()
async function getCredentials() {
const url = `${process.env.SETTINGS_URL}/settings/api/internal/integration/mqtt`
const url = `${process.env.SETTINGS_URL}/settings/api/internal/integration/mqtt_plant`
const res = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.SETTINGS_SECRET}` },
signal: AbortSignal.timeout(5000),