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 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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue