removed authorization for browser user
This commit is contained in:
+1
-12
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user