Merge pull request #21837 from johnphilip283/regenerate-token-on-fetch

TechDocs Collator: Regenerate token on every fetch to the search index
This commit is contained in:
Fredrik Adelöw
2023-12-13 16:46:51 +01:00
committed by GitHub
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-techdocs-backend': patch
---
Regenerates a fresh token for each call to the search index when collating techdocs.
@@ -136,6 +136,7 @@ export class DefaultTechDocsCollator {
);
try {
const { token: newToken } = await tokenManager.getToken();
const searchIndexResponse = await fetch(
DefaultTechDocsCollator.constructDocsIndexUrl(
techDocsBaseUrl,
@@ -143,7 +144,7 @@ export class DefaultTechDocsCollator {
),
{
headers: {
Authorization: `Bearer ${token}`,
Authorization: `Bearer ${newToken}`,
},
},
);