Skip to content

Commit eda9e88

Browse files
CB-2559 not update navigator model if context not changed
1 parent 78b00e7 commit eda9e88

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/session/WebSession.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -957,8 +957,10 @@ public synchronized void resetAuthToken() throws DBException {
957957
}
958958

959959
public synchronized void updateSMAuthInfo(SMAuthInfo smAuthInfo) throws DBException {
960-
userContext.refresh(smAuthInfo);
961-
refreshUserData();
960+
boolean contextChanged = userContext.refresh(smAuthInfo);
961+
if (contextChanged) {
962+
refreshUserData();
963+
}
962964
}
963965

964966
@Override

server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/session/WebUserContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public WebUserContext(WebApplication application) throws DBException {
6565
* @param smAuthInfo - auth info from security manager
6666
* @throws DBException - if user already authorized and new token come from another user
6767
*/
68-
public synchronized void refresh(SMAuthInfo smAuthInfo) throws DBException {
68+
public synchronized boolean refresh(SMAuthInfo smAuthInfo) throws DBException {
6969
if (smAuthInfo.getAuthStatus() != SMAuthStatus.SUCCESS) {
7070
throw new DBCException("Authorization did not complete successfully");
7171
}
@@ -92,7 +92,7 @@ public synchronized void refresh(SMAuthInfo smAuthInfo) throws DBException {
9292
this.smSessionId = smAuthInfo.getAuthPermissions().getSessionId();
9393
setUser(authPermissions.getUserId() == null ? null : new WebUser(securityController.getUserById(authPermissions.getUserId())));
9494
}
95-
95+
return isSessionChanged;
9696
}
9797

9898
public synchronized void refreshSMSession() throws DBException {

0 commit comments

Comments
 (0)