mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
dbeaver/pro#7082 use same ws connection after relogin fix (#3803)
This commit is contained in:
+1
-1
@@ -29,8 +29,8 @@ import org.jkiss.dbeaver.model.auth.SMAuthSpace;
|
||||
import org.jkiss.dbeaver.model.auth.SMSessionContext;
|
||||
import org.jkiss.dbeaver.model.auth.impl.AbstractSessionPersistent;
|
||||
import org.jkiss.dbeaver.model.meta.Property;
|
||||
import org.jkiss.dbeaver.model.security.user.SMTeam;
|
||||
import org.jkiss.dbeaver.model.rm.RMProjectInfo;
|
||||
import org.jkiss.dbeaver.model.security.user.SMTeam;
|
||||
import org.jkiss.dbeaver.model.websocket.event.WSEvent;
|
||||
import org.jkiss.dbeaver.model.websocket.event.WSEventDeleteTempFile;
|
||||
import org.jkiss.dbeaver.model.websocket.event.session.WSSessionExpiredEvent;
|
||||
|
||||
+2
-6
@@ -793,7 +793,7 @@ public class WebSession extends BaseWebSession
|
||||
}
|
||||
}
|
||||
|
||||
public List<WebAuthInfo> removeAuthInfo(String providerId, boolean needResetUserState) throws DBException {
|
||||
public List<WebAuthInfo> removeAuthInfo(String providerId) throws DBException {
|
||||
List<WebAuthInfo> oldInfo;
|
||||
if (providerId == null) {
|
||||
oldInfo = clearAuthTokens();
|
||||
@@ -806,16 +806,12 @@ public class WebSession extends BaseWebSession
|
||||
oldInfo = List.of();
|
||||
}
|
||||
}
|
||||
if (authTokens.isEmpty() && needResetUserState) {
|
||||
if (authTokens.isEmpty()) {
|
||||
resetUserState();
|
||||
}
|
||||
return oldInfo;
|
||||
}
|
||||
|
||||
public List<WebAuthInfo> removeAuthInfo(String providerId) throws DBException {
|
||||
return removeAuthInfo(providerId, true);
|
||||
}
|
||||
|
||||
public List<DBACredentialsProvider> getContextCredentialsProviders() {
|
||||
return getAdapters(DBACredentialsProvider.class);
|
||||
}
|
||||
|
||||
+2
-8
@@ -224,10 +224,8 @@ public class WebServiceAuthImpl implements DBWServiceAuth {
|
||||
throw new DBWebException("Not logged in");
|
||||
}
|
||||
try {
|
||||
List<WebAuthInfo> removedInfos = webSession.removeAuthInfo(providerId, false);
|
||||
List<WebAuthInfo> removedInfos = webSession.removeAuthInfo(providerId);
|
||||
var cbApp = CBApplication.getInstance();
|
||||
cbApp.getSessionManager().closeSession(webSession.getSessionId(), false);
|
||||
webSession.resetUserState();
|
||||
|
||||
List<String> logoutUrls = new ArrayList<>();
|
||||
String origin = ServletAppUtils.getOriginFromRequest(httpRequest);
|
||||
@@ -268,11 +266,7 @@ public class WebServiceAuthImpl implements DBWServiceAuth {
|
||||
public WebUserInfo activeUser(@NotNull WebSession webSession) throws DBWebException {
|
||||
if (webSession.getUser() == null) {
|
||||
ServletApplication application = webSession.getApplication();
|
||||
if (application.getAppConfiguration().isAnonymousAccessEnabled() && webSession.isAuthorizedInSecurityManager()) {
|
||||
SMUser anonymous = new SMUser("anonymous", true, null);
|
||||
return new WebUserInfo(webSession, new WebUser(anonymous));
|
||||
}
|
||||
if (!application.isAnonymousAccessEnabled()) {
|
||||
if (!application.getAppConfiguration().isAnonymousAccessEnabled() || !webSession.isAuthorizedInSecurityManager()) {
|
||||
return null;
|
||||
}
|
||||
SMUser anonymous = new SMUser("anonymous", true, null);
|
||||
|
||||
Reference in New Issue
Block a user