mirror of https://github.com/portainer/portainer
fix(kube): clear kube cache on login/logout [EE-6620] (#11026)
parent
89359dae8c
commit
70deba50ba
|
@ -1,6 +1,7 @@
|
||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
import uuidv4 from 'uuid/v4';
|
import uuidv4 from 'uuid/v4';
|
||||||
import { getEnvironments } from '@/react/portainer/environments/environment.service';
|
import { getEnvironments } from '@/react/portainer/environments/environment.service';
|
||||||
|
import { dispatchCacheRefreshEvent } from '@/portainer/services/http-request.helper';
|
||||||
|
|
||||||
class AuthenticationController {
|
class AuthenticationController {
|
||||||
/* @ngInject */
|
/* @ngInject */
|
||||||
|
@ -261,6 +262,9 @@ class AuthenticationController {
|
||||||
this.LocalStorage.cleanLogoutReason();
|
this.LocalStorage.cleanLogoutReason();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// always clear the kubernetes cache on login
|
||||||
|
dispatchCacheRefreshEvent();
|
||||||
|
|
||||||
if (this.Authentication.isAuthenticated()) {
|
if (this.Authentication.isAuthenticated()) {
|
||||||
await this.postLoginSteps();
|
await this.postLoginSteps();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
|
import { dispatchCacheRefreshEvent } from '@/portainer/services/http-request.helper';
|
||||||
|
|
||||||
class LogoutController {
|
class LogoutController {
|
||||||
/* @ngInject */
|
/* @ngInject */
|
||||||
|
@ -30,6 +31,9 @@ class LogoutController {
|
||||||
try {
|
try {
|
||||||
await this.Authentication.logout();
|
await this.Authentication.logout();
|
||||||
} finally {
|
} finally {
|
||||||
|
// always clear the kubernetes cache
|
||||||
|
dispatchCacheRefreshEvent();
|
||||||
|
|
||||||
this.LocalStorage.storeLogoutReason(error);
|
this.LocalStorage.storeLogoutReason(error);
|
||||||
if (settings.OAuthLogoutURI && this.Authentication.getUserDetails().ID !== 1) {
|
if (settings.OAuthLogoutURI && this.Authentication.getUserDetails().ID !== 1) {
|
||||||
this.$window.location.href = settings.OAuthLogoutURI;
|
this.$window.location.href = settings.OAuthLogoutURI;
|
||||||
|
|
Loading…
Reference in New Issue