Fix API calls using a bearer auth token

This commit is contained in:
2020-04-22 09:17:30 +02:00
parent 272773692f
commit 17feb712b9
6 changed files with 17 additions and 10 deletions

View File

@@ -2,7 +2,10 @@
export async function preload (page, session) {
const req = await this.fetch(apiEndpoints.gql, {
method: 'post',
headers: { 'Content-Type': 'application/json' },
headers: {
'Content-Type': 'application/json',
'Authorization': 'bearer ' + process.env.CONFIG.API_TOKEN
},
body: JSON.stringify({ query: `{
site {
data {