techdocs-backend: use separate plugin request token when syncing cache

Signed-off-by: Oskar Jiang <oskarjiang94@gmail.com>
This commit is contained in:
Oskar Jiang
2024-08-20 08:17:51 +02:00
parent 632f95e670
commit 7b975ba628
@@ -252,10 +252,14 @@ export async function createRouter(
// However, if caching is enabled, take the opportunity to check and
// invalidate stale cache entries.
if (cache) {
const { token: techDocsToken } = await auth.getPluginRequestToken({
onBehalfOf: await auth.getOwnServiceCredentials(),
targetPluginId: 'techdocs',
});
await docsSynchronizer.doCacheSync({
responseHandler,
discovery,
token,
token: techDocsToken,
entity,
});
return;