[object Object]

← back to Rentv

Content Studio email: use raw GEORGE_AUTH token for local George :9850

70045f7137b5d53b23c088b3256e8da8fb104be9 · 2026-08-05 07:57:22 -0700 · steve

Files touched

Diff

commit 70045f7137b5d53b23c088b3256e8da8fb104be9
Author: steve <steve@designerwallcoverings.com>
Date:   Wed Aug 5 07:57:22 2026 -0700

    Content Studio email: use raw GEORGE_AUTH token for local George :9850
---
 server.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/server.js b/server.js
index 3adba62f..66e373c9 100644
--- a/server.js
+++ b/server.js
@@ -502,10 +502,12 @@ app.post('/api/content/find-image', adminOnly, async (req, res) => {
 // ── Content Studio: email the full assembled post to Boom via George ────────────
 const GEORGE_URL = process.env.GEORGE_URL || 'http://127.0.0.1:9850';
 const GEORGE_BASIC_AUTH = process.env.GEORGE_BASIC_AUTH || '';
+const GEORGE_AUTH = process.env.GEORGE_AUTH || ''; // local :9850 app expects the raw Authorization token
+const GEORGE_HDR = GEORGE_AUTH || (GEORGE_BASIC_AUTH ? 'Basic ' + GEORGE_BASIC_AUTH : '');
 const BOOM_EMAIL = process.env.BOOM_EMAIL || 'sbloom@rentv.com';
 app.post('/api/content/email', adminOnly, async (req, res) => {
   const b = req.body || {};
-  if (!GEORGE_BASIC_AUTH) return res.status(503).json({ ok: false, error: 'email not configured (GEORGE_BASIC_AUTH missing)' });
+  if (!GEORGE_HDR) return res.status(503).json({ ok: false, error: 'email not configured (GEORGE_AUTH/GEORGE_BASIC_AUTH missing)' });
   const title = clean(b.title, 200) || 'RENTV post';
   const html = `<h1>${clean(b.title, 200)}</h1>${b.dek ? `<p><em>${clean(b.dek, 300)}</em></p>` : ''}`
     + (b.image ? `<p><img src="${clean(b.image, 500)}" style="max-width:100%"><br><small>Photo: ${clean(b.photo_credit, 160) || '—'}</small></p>` : '')
@@ -514,7 +516,7 @@ app.post('/api/content/email', adminOnly, async (req, res) => {
     + (b.x ? `<h3>X</h3><p>${clean(b.x, 600)}</p>` : '');
   try {
     const r = await fetch(GEORGE_URL + '/api/send', {
-      method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: 'Basic ' + GEORGE_BASIC_AUTH },
+      method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: GEORGE_HDR },
       body: JSON.stringify({ account: 'steve-office', to: BOOM_EMAIL, subject: 'RENTV draft: ' + title, body: html }),
       signal: AbortSignal.timeout(25000),
     });

← 14ea3125 Content Studio: track building photo from credited broker/de  ·  back to Rentv  ·  auto-save: 2026-08-05T08:10:17 (4 files) — data/markets.json b4364477 →