Skip to content

Commit

Permalink
Clear cache on any 401 response errors (#1634)
Browse files Browse the repository at this point in the history
* fixes clear cache on 401/403

Signed-off-by: Shenoy Pratik <[email protected]>

* remove 403 check

Signed-off-by: Shenoy Pratik <[email protected]>

---------

Signed-off-by: Shenoy Pratik <[email protected]>
  • Loading branch information
ps48 authored Mar 26, 2024
1 parent 0e6dd62 commit ce4d69f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions public/framework/catalog_cache/cache_intercept.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit ce4d69f

Please sign in to comment.