make sure to pass in the auth token to the ancestry endpoint

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-03-14 14:39:02 +01:00
parent 9486c3e46c
commit 26fb159a30
2 changed files with 8 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend': patch
---
Pass in auth token to ancestry endpoint
@@ -158,7 +158,9 @@ export async function createRouter(
async (req, res) => {
const { kind, namespace, name } = req.params;
const entityRef = stringifyEntityRef({ kind, namespace, name });
const response = await entitiesCatalog.entityAncestry(entityRef);
const response = await entitiesCatalog.entityAncestry(entityRef, {
authorizationToken: getBearerToken(req.header('authorization')),
});
res.status(200).json(response);
},
)