1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-02 20:35:25 +02:00

fix(kube): clear kube cache on login/logout [EE-6620] (#11026)
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
ci / build_images (map[arch:arm64 platform:linux]) (push) Waiting to run
ci / build_manifests (push) Blocked by required conditions
/ triage (push) Waiting to run
Lint / Run linters (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
Test / test-client (push) Waiting to run
Test / test-server (map[arch:amd64 platform:linux]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
Test / test-server (map[arch:arm64 platform:linux]) (push) Waiting to run

This commit is contained in:
Matt Hook 2024-01-30 10:39:12 +13:00 committed by GitHub
parent 89359dae8c
commit 70deba50ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View file

@ -1,6 +1,7 @@
import angular from 'angular';
import uuidv4 from 'uuid/v4';
import { getEnvironments } from '@/react/portainer/environments/environment.service';
import { dispatchCacheRefreshEvent } from '@/portainer/services/http-request.helper';
class AuthenticationController {
/* @ngInject */
@ -261,6 +262,9 @@ class AuthenticationController {
this.LocalStorage.cleanLogoutReason();
}
// always clear the kubernetes cache on login
dispatchCacheRefreshEvent();
if (this.Authentication.isAuthenticated()) {
await this.postLoginSteps();
}

View file

@ -1,4 +1,5 @@
import angular from 'angular';
import { dispatchCacheRefreshEvent } from '@/portainer/services/http-request.helper';
class LogoutController {
/* @ngInject */
@ -30,6 +31,9 @@ class LogoutController {
try {
await this.Authentication.logout();
} finally {
// always clear the kubernetes cache
dispatchCacheRefreshEvent();
this.LocalStorage.storeLogoutReason(error);
if (settings.OAuthLogoutURI && this.Authentication.getUserDetails().ID !== 1) {
this.$window.location.href = settings.OAuthLogoutURI;