fix: enable external auth by using a different header (#87)

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
pull/739/head
Henrique Dias 2019-01-29 09:05:45 +00:00 committed by GitHub
parent 89d4d828b9
commit e370fbe500
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -88,7 +88,7 @@ export async function post (url, content = '', overwrite = false, onupload) {
return new Promise((resolve, reject) => {
let request = new XMLHttpRequest()
request.open('POST', `${baseURL}/api/resources${url}?override=${overwrite}`, true)
request.setRequestHeader('Authorization', `Bearer ${store.state.jwt}`)
request.setRequestHeader('X-Auth', store.state.jwt)
if (typeof onupload === 'function') {
request.upload.onprogress = onupload

View File

@ -10,7 +10,7 @@ export async function fetchURL (url, opts) {
const res = await fetch(`${baseURL}${url}`, {
headers: {
'Authorization': `Bearer ${store.state.jwt}`,
'X-Auth': store.state.jwt,
...headers
},
...rest

View File

@ -55,7 +55,7 @@ export async function renew (jwt) {
const res = await fetch(`${baseURL}/api/renew`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${jwt}`,
'X-Auth': jwt,
}
})