Skip to content

Commit

Permalink
dbeaver/pro#3465 udbt reconnect improve
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-skoblikov committed Oct 25, 2024
1 parent 0126b20 commit 930a8c1
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

import io.cloudbeaver.DBWebException;
import io.cloudbeaver.auth.SMTokenCredentialProvider;
import io.cloudbeaver.server.AppWebSessionManager;
import io.cloudbeaver.model.session.*;
import io.cloudbeaver.registry.WebHandlerRegistry;
import io.cloudbeaver.registry.WebSessionHandlerDescriptor;
import io.cloudbeaver.server.AppWebSessionManager;
import io.cloudbeaver.server.CBApplication;
import io.cloudbeaver.server.CBConstants;
import io.cloudbeaver.server.events.WSWebUtils;
Expand Down Expand Up @@ -315,6 +315,14 @@ public WebHeadlessSession getHeadlessSession(Request request, Session session, b
var existSession = sessionMap.get(sessionId);

if (existSession instanceof WebHeadlessSession) {
var creds = existSession.getUserContext().getActiveUserCredentials();
if (creds == null || !smAccessToken.equals(creds.getSmAccessToken())) {
existSession.getUserContext().refresh(
smAccessToken,
null,
authPermissions
);
}
return (WebHeadlessSession) existSession;
}
if (existSession != null) {
Expand Down

0 comments on commit 930a8c1

Please sign in to comment.