Add node modules and package files

This commit is contained in:
Rachael Sewell
2019-09-06 15:17:38 -07:00
parent e84489cd02
commit 714607abe9
165 changed files with 2227 additions and 4644 deletions

View File

@@ -10,20 +10,20 @@ function authenticationBeforeRequest (state, options) {
if (state.auth.type === 'basic') {
const hash = btoa(`${state.auth.username}:${state.auth.password}`)
options.headers['authorization'] = `Basic ${hash}`
options.headers.authorization = `Basic ${hash}`
return
}
if (state.auth.type === 'token') {
options.headers['authorization'] = `token ${state.auth.token}`
options.headers.authorization = `token ${state.auth.token}`
return
}
if (state.auth.type === 'app') {
options.headers['authorization'] = `Bearer ${state.auth.token}`
const acceptHeaders = options.headers['accept'].split(',')
options.headers.authorization = `Bearer ${state.auth.token}`
const acceptHeaders = options.headers.accept.split(',')
.concat('application/vnd.github.machine-man-preview+json')
options.headers['accept'] = uniq(acceptHeaders).filter(Boolean).join(',')
options.headers.accept = uniq(acceptHeaders).filter(Boolean).join(',')
return
}