Editor: token from ?key= URL param (survives per-origin/per-browser storage)

This commit is contained in:
FuelBoard Contributor
2026-08-13 12:57:44 +01:00
parent a597157622
commit 9136a138de
+6 -1
View File
@@ -69,7 +69,12 @@
<script>
const KEY = "fbEditorToken";
let token = localStorage.getItem(KEY) || "";
// Accept the token from the URL (?key=…): a bookmarked link survives storage
// limits — localStorage is per-origin AND per-browser (Telegram's in-app
// browser doesn't share Safari's storage; private mode doesn't persist at all).
const urlKey = new URLSearchParams(location.search).get("key");
let token = urlKey || localStorage.getItem(KEY) || "";
if (urlKey) localStorage.setItem(KEY, urlKey);
let pollTimer = null;
async function api(path, opts = {}) {