mirror of
https://github.com/directus/directus.git
synced 2026-01-24 14:37:58 -05:00
Auth patch to @directus/gatsby-source-directus (#7119)
Gatsby needs one-time access to the images at build time with the secure access token. With this security patch it is now no longer needed to have all Directus files continuously exposed to the public. Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
This commit is contained in:
@@ -169,7 +169,7 @@ exports.sourceNodes = async (gatsby, options) => {
|
||||
exports.createResolvers = async ({ actions, cache, createNodeId, createResolvers, store, reporter }, options) => {
|
||||
const { createNode } = actions;
|
||||
|
||||
const { url } = options;
|
||||
const { url, auth } = options;
|
||||
|
||||
let endpoints = normalizeEndpoint(url);
|
||||
|
||||
@@ -187,6 +187,7 @@ exports.createResolvers = async ({ actions, cache, createNodeId, createResolvers
|
||||
cache,
|
||||
createNode,
|
||||
createNodeId,
|
||||
httpHeaders: { Authorization: `Bearer ${auth.token}` },
|
||||
reporter,
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user