mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Remomved userid from cluster name. Turned off keycloak interval for token refresh
This commit is contained in:
parent
1f36e06cc8
commit
9c2c6b1c71
@ -114,7 +114,7 @@ export class DECCManager {
|
||||
const clusterPrefix = `decc`
|
||||
|
||||
clusterStore.getByWorkspaceId(workspace.id).forEach(cluster => {
|
||||
if (cluster.preferences.clusterName === `${username}@${clusterPrefix}-${deccCluster.metadata.name}`) {
|
||||
if (cluster.preferences.clusterName === `${clusterPrefix}-${deccCluster.metadata.name}`) {
|
||||
clusterPresent = true;
|
||||
}
|
||||
});
|
||||
@ -143,23 +143,12 @@ export class DECCManager {
|
||||
id: deccCluster.metadata.uid,
|
||||
contextName: `${username}@${clusterPrefix}-${deccCluster.metadata.name}`,
|
||||
preferences: {
|
||||
clusterName: `${username}@${clusterPrefix}-${deccCluster.metadata.name}`,
|
||||
clusterName: `${clusterPrefix}-${deccCluster.metadata.name}`,
|
||||
httpsProxy: undefined,
|
||||
},
|
||||
kubeConfigPath: ClusterStore.embedCustomKubeConfig(deccCluster.metadata.uid, YAML.stringify(jsConfig)),
|
||||
workspace: workspace.id,
|
||||
};
|
||||
|
||||
// let newCluster = new Cluster({
|
||||
// id: deccCluster.metadata.uid,
|
||||
// contextName: `${username}@${clusterPrefix}-${deccCluster.metadata.name}`,
|
||||
// preferences: {
|
||||
// clusterName: `${username}@${clusterPrefix}-${deccCluster.metadata.name}`,
|
||||
// httpsProxy: undefined,
|
||||
// },
|
||||
// kubeConfigPath: ClusterStore.embedCustomKubeConfig(deccCluster.metadata.uid, YAML.stringify(jsConfig)),
|
||||
// workspace: workspace.id,
|
||||
// });
|
||||
|
||||
newClusters.push(newCluster);
|
||||
clusterStore.addCluster(...newClusters);
|
||||
|
||||
@ -28,13 +28,13 @@ if(logoutUser){
|
||||
ipcRenderer.send('keycloak-token', keycloak.idToken, keycloak.refreshToken);
|
||||
|
||||
//TODO: check if token refresh is possible here
|
||||
setInterval(() => {
|
||||
let tokenRefreshAt = new Date();
|
||||
console.log(`keycloak interval: ${tokenRefreshAt.toString()}`);
|
||||
keycloak.updateToken(10).error(() => keycloak.logout());
|
||||
console.log(keycloak.token);
|
||||
ipcRenderer.send('keycloak-token-update', keycloak.idToken, keycloak.refreshToken);
|
||||
}, 10000);
|
||||
// setInterval(() => {
|
||||
// let tokenRefreshAt = new Date();
|
||||
// console.log(`keycloak interval: ${tokenRefreshAt.toString()}`);
|
||||
// keycloak.updateToken(10).error(() => keycloak.logout());
|
||||
// console.log(keycloak.token);
|
||||
// ipcRenderer.send('keycloak-token-update', keycloak.idToken, keycloak.refreshToken);
|
||||
// }, 10000);
|
||||
}
|
||||
}).error(function(error) {
|
||||
console.log('error: ' + JSON.stringify(error));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user