use of com.haulmont.cuba.security.global.MismatchedUserSessionException in project cuba by cuba-platform.
the class WebUserSessionSource method checkUiSession.
protected void checkUiSession(UserSession session, AppUI ui) {
Connection connection = ui.getApp().getConnection();
UserSession appUserSession = connection.getSession();
boolean appAuthenticated = connection.isAuthenticated();
boolean uiAuthenticated = ui.hasAuthenticatedSession();
if (!appAuthenticated && uiAuthenticated) {
throw new MismatchedUserSessionException(session.getId());
}
if (appAuthenticated && uiAuthenticated && !Objects.equals(appUserSession, session)) {
throw new MismatchedUserSessionException(session.getId());
}
}
Aggregations