Refactor
This commit is contained in:
parent
39b138d45b
commit
f8158ee6ae
@ -268,6 +268,7 @@ public class DefaultSystemSecurityService implements SystemSecurityService {
|
||||
String browser = "Unknown";
|
||||
String os = "Unknown";
|
||||
String device = "Unknown";
|
||||
String provider = null;
|
||||
if (authenticationDetails instanceof RestAuthenticationDetails) {
|
||||
RestAuthenticationDetails details = (RestAuthenticationDetails) authenticationDetails;
|
||||
clientAddress = details.getClientAddress();
|
||||
@ -308,9 +309,12 @@ public class DefaultSystemSecurityService implements SystemSecurityService {
|
||||
if (actionType == ActionType.LOGIN && e == null) {
|
||||
userService.setLastLoginTs(user.getTenantId(), user.getId());
|
||||
}
|
||||
if (user.getAdditionalInfo() != null && user.getAdditionalInfo().has("authProviderName")) {
|
||||
provider = user.getAdditionalInfo().get("authProviderName").asText();
|
||||
}
|
||||
auditLogService.logEntityAction(
|
||||
user.getTenantId(), user.getCustomerId(), user.getId(),
|
||||
user.getName(), user.getId(), null, actionType, e, clientAddress, browser, os, device, user.getAdditionalInfo());
|
||||
user.getName(), user.getId(), null, actionType, e, clientAddress, browser, os, device, provider);
|
||||
}
|
||||
|
||||
private static boolean isPositiveInteger(Integer val) {
|
||||
|
||||
@ -257,13 +257,13 @@ public class AuditLogServiceImpl implements AuditLogService {
|
||||
String browser = extractParameter(String.class, 1, additionalInfo);
|
||||
String os = extractParameter(String.class, 2, additionalInfo);
|
||||
String device = extractParameter(String.class, 3, additionalInfo);
|
||||
JsonNode provider = extractParameter(JsonNode.class, 4, additionalInfo);
|
||||
String provider = extractParameter(String.class, 4, additionalInfo);
|
||||
actionData.put("clientAddress", clientAddress);
|
||||
actionData.put("browser", browser);
|
||||
actionData.put("os", os);
|
||||
actionData.put("device", device);
|
||||
if (provider != null && provider.has("authProviderName")) {
|
||||
actionData.put("provider", provider.get("authProviderName").asText());
|
||||
if (org.springframework.util.StringUtils.hasText(provider)) {
|
||||
actionData.put("provider", provider);
|
||||
}
|
||||
break;
|
||||
case PROVISION_SUCCESS:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user