protected T setSessionCookieAndWrapExceptions <T>(JiraServer server, JiraAuthenticatedClient client, Wrapped <T> wrapped) { try { setSessionCookie(server, client); return(wrapped()); } catch (Exception) { removeSessionCookie(server); throw; } }
private void setSessionCookie(JiraServer server, JiraAuthenticatedClient client) { if (server.OldSkoolAuth) { return; } lock (rssSessionCookieMap) { var key = CredentialUtils.getSessionOrTokenKey(server); if (rssSessionCookieMap.ContainsKey(key)) { client.SessionTokens = rssSessionCookieMap[key]; } else { rssSessionCookieMap[key] = client.login(); } } }