directus / gatsby-source-directus

Source plugin for pulling data into Gatsby from a Directus API.
11 stars 12 forks source link

Fix headers promise #17

Closed freekrai closed 1 year ago

freekrai commented 1 year ago

this PR fixes headers returning incorrect bearer token as:

if (this.directus.auth.token) {
    Object.assign(headers, {
        Authorization: `Bearer ${this.directus.auth.token}`,
    });
}

would set Bearer token as a promise rather than the actual token.