Skip to content

Commit

Permalink
fix: enable external auth by using a different header (#87)
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
  • Loading branch information
hacdias committed Jan 29, 2019
1 parent 89d4d82 commit e370fbe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/api/files.js
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/api/utils.js
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/utils/auth.js
Expand Up @@ -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,
}
})

Expand Down

0 comments on commit e370fbe

Please sign in to comment.