removed authorization for browser user

This commit is contained in:
2026-08-09 17:25:45 +02:00
parent b477737bad
commit 2677c81d0f
4 changed files with 18 additions and 61 deletions
+1 -12
View File
@@ -1,20 +1,9 @@
const status = document.querySelector('#status');
const buttons = [...document.querySelectorAll('.group-button')];
const apiPrefix = document.body.dataset.apiPrefix;
const url = new URL(window.location.href);
const suppliedKey = url.searchParams.get('key');
if (suppliedKey) {
sessionStorage.setItem('fasthue-api-key', suppliedKey);
url.searchParams.delete('key');
history.replaceState({}, '', url);
}
const apiKey = sessionStorage.getItem('fasthue-api-key');
function apiFetch(path, options = {}) {
return fetch(path, {
...options,
headers: { ...options.headers, Authorization: `Bearer ${apiKey || ''}` },
});
return fetch(path, options);
}
function showStatus(message, persistent = false) {