Как программно закрыть сессию пользователя?

Сценарий такой:
Запрашиваем пользователя согласие на обработку персданных, он отказывается – выкидываем его из приложения.

Логин-пароль у него есть, проверка происходит при первом входе в систему.
Проверка выполняется в главном экране, все ОК. Но никак не найду, как завершить сессию.

protected void initLayout(@SuppressWarnings(“unused”) InitEvent event) {

    Employee employee = (Employee) userSessionSource.getUserSession().getUser();
    if (employee.getPdnAgreementTs() == null) {
        screenBuilders.screen(this)
                .withScreenClass(PersonalDataAgreement.class)
                .withAfterCloseListener(afterCloseEvent -> {
                    if (afterCloseEvent.closedWith(StandardOutcome.COMMIT)) {
                     employee.setPdnAgreementTs(LocalDateTime.now());
                     dataManager.commit(employee);
                    }
                    if (afterCloseEvent.closedWith(StandardOutcome.DISCARD)) {

// Что написать здесь?
}
})
.build()
.show();
}

Посмотрите бин userSessionService.
Там есть бин для закрытия сессии по ее ID - killSession()

Я бы посмотрел на то, что делает компонент
com.haulmont.cuba.gui.components.mainwindow.LogoutButton
, то есть его реализация WebLogoutButton.

Там вызывается следующий код:

        AppUI ui = ((AppUI) component.getUI());
        if (ui == null) {
            throw new IllegalStateException("Logout button is not attached to UI");
        }
        ui.getApp().logout();