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]>
(cherry picked from commit ce4d69f)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Mar 26, 2024
1 parent 79faaeb commit 679bded
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 {

Check warning on line 12 in public/framework/catalog_cache/cache_intercept.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
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 679bded

Please sign in to comment.