Skip to content

Commit

Permalink
CB-5584 VSC fix
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-rider committed Nov 22, 2024
1 parent ae1f0b7 commit 350136f
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
*/
package io.cloudbeaver.server.graphql;

import io.cloudbeaver.model.app.BaseWebApplication;
import io.cloudbeaver.model.session.WebSession;
import io.cloudbeaver.server.CBApplication;
import io.cloudbeaver.server.CBPlatform;
import jakarta.servlet.http.HttpServletRequest;
import org.jkiss.code.Nullable;
import org.jkiss.utils.CommonUtils;

import java.util.Map;
Expand Down Expand Up @@ -51,13 +53,18 @@ public static String getSessionId(HttpServletRequest request) {
return session.getUserContext().getSmSessionId();
}

@Nullable
private static WebSession getWebSession(HttpServletRequest request) {
if (request.getSession() == null) {
return null;
}
return (WebSession) CBApplication.getInstance()
.getSessionManager()
.getSession(request.getSession().getId());

if (BaseWebApplication.getInstance() instanceof CBApplication<?> cbApp) {
return (WebSession)cbApp.getSessionManager()
.getSession(request.getSession().getId());
} else {
return null;
}
}

public static String buildLoggerMessage(String sessionId, String userId, Map<String, Object> variables) {
Expand Down

0 comments on commit 350136f

Please sign in to comment.