feat/youtube-growth-toolkit #8

Merged
pedro-bento merged 10 commits from feat/youtube-growth-toolkit into main 2026-10-05 20:33:57 +01:00
Showing only changes of commit 7c260b3fa1 - Show all commits

View file

@ -159,14 +159,23 @@ const postizHeaders = (key, url) => {
// Older builds defaulted to a maintainer-hosted Postiz instance and persisted // Older builds defaulted to a maintainer-hosted Postiz instance and persisted
// it to localStorage on mount, so an upgrade could silently keep sending a // it to localStorage on mount, so an upgrade could silently keep sending a
// user's API key to someone else's server. Recognize that retired default and // user's API key to a server they never chose. Retire that one legacy value
// treat it as unset. The host is assembled from parts so no live reference to // ONCE (guarded by a marker) instead of on every read: blanking it on each load
// it remains in the source. // also threw away a URL the user deliberately saved — a self-hoster's own
// instance can legitimately live on that host — and forced them to retype it
// every session. The host is assembled from parts so no live reference to it
// remains in the source.
const RETIRED_POSTIZ_HOST = ['postiz', 'pbento', 'pt'].join('.'); const RETIRED_POSTIZ_HOST = ['postiz', 'pbento', 'pt'].join('.');
const POSTIZ_URL_RETIRED_KEY = 'postiz_url_retired_v1';
const normalizeStoredPostizUrl = (url) => { const normalizeStoredPostizUrl = (url) => {
const base = String(url || '').trim().replace(/\/$/, ''); const base = String(url || '').trim().replace(/\/$/, '');
if (!base) return ''; if (!base) return '';
return base === `https://${RETIRED_POSTIZ_HOST}` ? '' : base; let retired = false;
try {
retired = localStorage.getItem(POSTIZ_URL_RETIRED_KEY) === '1';
localStorage.setItem(POSTIZ_URL_RETIRED_KEY, '1');
} catch (_) { /* storage unavailable: nothing to migrate */ }
return !retired && base === `https://${RETIRED_POSTIZ_HOST}` ? '' : base;
}; };
const SESSION_KEY = 'clipwright_session'; const SESSION_KEY = 'clipwright_session';