Make sure Authorization header is not set when using cookie based auth

This commit is contained in:
Jackson Harper
2023-05-22 18:24:41 +08:00
parent da6e32df8f
commit 215bd7f58f
3 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,7 @@
function gqlRequest(apiUrl, query) { function gqlRequest(apiUrl, query) {
return getStorageItem('apiKey') return getStorageItem('apiKey')
.then((apiKey) => { .then((apiKey) => {
const auth = apiKey ? { Authorization: apiKey } : {}
return fetch(apiUrl, { return fetch(apiUrl, {
method: 'POST', method: 'POST',
redirect: 'follow', redirect: 'follow',
@ -9,7 +10,7 @@ function gqlRequest(apiUrl, query) {
headers: { headers: {
Accept: 'application/json', Accept: 'application/json',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
Authorization: apiKey ? apiKey : undefined, ...auth,
}, },
body: query, body: query,
}) })

View File

@ -316,13 +316,14 @@
'.omnivore-top-button-label' '.omnivore-top-button-label'
) )
labels.forEach((label) => { labels.forEach((label) => {
console.log(' - hiding label', label)
label.style.display = 'none' label.style.display = 'none'
}) })
const container = root.shadowRoot.querySelector( const container = root.shadowRoot.querySelector(
'#omnivore-toast-container' '#omnivore-toast-container'
) )
container.style.width = '280px' container.style.width = '280px'
container.style.top = 'unset'
container.style.bottom = '20px'
} }
} }

View File

@ -2,7 +2,7 @@
#omnivore-toast-container { #omnivore-toast-container {
position: fixed; position: fixed;
top: 20px; top: 20px;
right: 30px; right: 20px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;