private static void logoutUserImpl(ApplicationUser user) { ActionContext.getSession().put(DefaultAuthenticator.LOGGED_OUT_KEY, user); ComponentAccessor.getComponent(JiraAuthenticationContext.class).clearLoggedInUser(); }
private static JobRunnerResponse runService(final JiraServiceContainer service) { // make the logs come out with the name of the running service final String serviceName = service.getName(); setLog4JInfo(MOCK_USER_NAME, serviceName); try { if (LOG.isDebugEnabled()) { LOG.debug("Running Service [" + service + ']'); } ComponentAccessor.getJiraAuthenticationContext().clearLoggedInUser(); service.run(); if (LOG.isDebugEnabled()) { LOG.debug("Finished Running Service [" + service + ']'); } return JobRunnerResponse.success(); } catch (final RuntimeException e) { LOG.error("An error occurred while trying to run service '" + serviceName + "'. " + e.getMessage(), e); return JobRunnerResponse.failed(e); } finally { service.setLastRun(); setLog4JInfo(MOCK_USER_NAME, ""); } }
jiraAuthenticationContext.clearLoggedInUser(); request.setAttribute("jira.logout.page.executed",Boolean.TRUE);