Skip to content

Commit

Permalink
Avoid unnecessary CTS call if there's no session in LoginState
Browse files Browse the repository at this point in the history
  • Loading branch information
maximthomas committed Jan 19, 2024
1 parent 645500f commit 89238b5
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1608,8 +1608,10 @@ public void setLocale(String locale) {
/* destroy session */
void destroySession() {
if (sessionReference != null) {
AuthUtils.removeAuthContext(finalSessionId);
LazyConfig.AUTHD.destroySession(finalSessionId);
if(!isNoSession()) {
AuthUtils.removeAuthContext(finalSessionId);
LazyConfig.AUTHD.destroySession(finalSessionId);
}
finalSessionId = null;
sessionReference = null;
}
Expand Down Expand Up @@ -4232,7 +4234,7 @@ void logSuccess() {
String[] data = dataList.toArray(new String[dataList.size()]);
String contextId = null;
SSOToken localSSOToken = null;
if (!isNoSession()) {
if (!isNoSession() && oldSessionReference != null) {
localSSOToken = getSSOToken();
}
if (localSSOToken != null) {
Expand All @@ -4252,7 +4254,11 @@ void logSuccess() {
if (authMethName != null) {
props.put(LogConstants.MODULE_NAME, authMethName);
}
InternalSession session = getReferencedSession();
InternalSession session = null;
if(!isNoSession()) {
session = getReferencedSession();
}

if (session != null) {
props.put(LogConstants.LOGIN_ID_SID, finalSessionId.toString());
}
Expand Down

0 comments on commit 89238b5

Please sign in to comment.