From 29ff50200ad1c2a6b5bb82a8aefb2781bd7470cf Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 28 Mar 2024 12:11:21 -0700 Subject: [PATCH] Clear cache on any 401 response errors (#1634) (#1635) * fixes clear cache on 401/403 * remove 403 check --------- (cherry picked from commit ce4d69fc9a6973ac3232b8b58462d8b7feb1dd94) Signed-off-by: Shenoy Pratik Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- public/framework/catalog_cache/cache_intercept.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/public/framework/catalog_cache/cache_intercept.ts b/public/framework/catalog_cache/cache_intercept.ts index a44256aed..3f50bf00b 100644 --- a/public/framework/catalog_cache/cache_intercept.ts +++ b/public/framework/catalog_cache/cache_intercept.ts @@ -7,15 +7,11 @@ import { HttpInterceptorResponseError, IHttpInterceptController, } from '../../../../../src/core/public'; -import { SECURITY_PLUGIN_ACCOUNT_API } from '../../../common/constants/shared'; import { CatalogCacheManager } from './cache_manager'; export function catalogCacheInterceptError(): any { return (httpErrorResponse: HttpInterceptorResponseError, _: IHttpInterceptController) => { - if ( - httpErrorResponse.response?.status === 401 && - httpErrorResponse.fetchOptions.path === SECURITY_PLUGIN_ACCOUNT_API - ) { + if (httpErrorResponse.response?.status === 401) { // Clears all user catalog cache details CatalogCacheManager.clearDataSourceCache(); CatalogCacheManager.clearAccelerationsCache();