From ef06cd4baa1649b52b8f68890a0bb2484d38188e Mon Sep 17 00:00:00 2001 From: martbost Date: Thu, 8 Oct 2026 15:40:10 -0500 Subject: [PATCH] /my redirector as an external script (CSP allows no inline scripts) Co-Authored-By: Claude Fable 5.1 --- public/assets/my-redirect.js | 9 +++++++++ server.js | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 public/assets/my-redirect.js diff --git a/public/assets/my-redirect.js b/public/assets/my-redirect.js new file mode 100644 index 0000000..446c3f0 --- /dev/null +++ b/public/assets/my-redirect.js @@ -0,0 +1,9 @@ +// The classic /my dashboard is retired (2026-10-08). Old links, emails and bookmarks carry a #pane; send each to the +// control-room screen that replaced it. External file on purpose: the site's CSP allows no inline scripts. +(function () { + var M = { '': '/links', overview: '/tools', line: '/team', pipeline: '/tools#pipeline', buy: '/credits', rotator: '/links', + campaigns: '/ads', earn: '/ads', earnings: '/credits', promo: '/tools#promo', training: '/tools#training', + wallet: '/wallet', profile: '/tools#profile' }; + var h = (location.hash || '').slice(1).toLowerCase(); + location.replace(M.hasOwnProperty(h) ? M[h] : '/tools#' + h); +})(); diff --git a/server.js b/server.js index c58e9b9..afb953b 100644 --- a/server.js +++ b/server.js @@ -3043,7 +3043,7 @@ const server = http.createServer(async (req, res) => { if (p === '/tools') return sendFile(res, path.join(PUBLIC_DIR, 'my.html')); // classic panes the control room lacks (More) if (p === '/my') { // retired 2026-10-08: old links/emails/bookmarks land on the right control-room screen by #pane res.writeHead(200, baseHeaders({ 'Content-Type': 'text/html; charset=utf-8', 'Cache-Control': 'no-store' })); - return res.end('LinkSpin'); + return res.end('LinkSpin'); } if (p === '/links') return sendFile(res, path.join(PUBLIC_DIR, 'links.html')); // Control Room: the links workspace, first screen of the new front end (2026-09-29) if (p === '/reports') return sendFile(res, path.join(PUBLIC_DIR, 'reports.html'));