[object Object]

← back to Dw Launches

dw-launches: pass through Norma's real publish reason (token-expired / no-creds) instead of stale hardcoded 'code not enabled' string

763635bd5414b15193373ed05b9c1c885a746405 · 2026-06-22 17:13:54 -0700 · Steve

Files touched

Diff

commit 763635bd5414b15193373ed05b9c1c885a746405
Author: Steve <steve@designerwallcoverings.com>
Date:   Mon Jun 22 17:13:54 2026 -0700

    dw-launches: pass through Norma's real publish reason (token-expired / no-creds) instead of stale hardcoded 'code not enabled' string
---
 server.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/server.js b/server.js
index 9da996e..aa594c8 100644
--- a/server.js
+++ b/server.js
@@ -233,7 +233,15 @@ const LIVE_CHANNELS = {
     const j = await r.json().catch(() => ({}));
     const res = (j && j.result) || {};
     if (res.simulated || res.posted === false) {
-      return { posted: false, simulated: true, permalink: res.permalink || null, reason: 'Norma is in simulation mode (no live IG credentials / real-post code not enabled).' };
+      return {
+        posted: false,
+        simulated: !!res.simulated,
+        needs_reconnect: !!res.needs_reconnect,
+        permalink: res.permalink || null,
+        // Pass through Norma's real reason (e.g. "token expired — reconnect",
+        // "no credentials configured") instead of a hardcoded string.
+        reason: res.reason || 'Norma did not post (no live Instagram credentials).',
+      };
     }
     return { posted: true, permalink: res.permalink || null, media_id: res.media_id || null, via: 'norma' };
   },

← 60312c9 auto-save: 2026-06-22T13:36:34 (1 files) — data/launches.jso  ·  back to Dw Launches  ·  (newest)