From 2a4696750e76a4eb7c125c2a8999ed59dbd8d9cf Mon Sep 17 00:00:00 2001 From: shekhar16 Date: Fri, 3 Nov 2023 01:16:02 +0530 Subject: [PATCH] feat(oxtrust=server): #2378 sync gluuStatus with oxTrustActive attribute --- .../org/gluu/oxtrust/action/UpdatePersonAction.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/gluu/oxtrust/action/UpdatePersonAction.java b/server/src/main/java/org/gluu/oxtrust/action/UpdatePersonAction.java index 39540480b..13383fc8d 100644 --- a/server/src/main/java/org/gluu/oxtrust/action/UpdatePersonAction.java +++ b/server/src/main/java/org/gluu/oxtrust/action/UpdatePersonAction.java @@ -37,6 +37,7 @@ import org.gluu.oxauth.model.fido.u2f.protocol.DeviceData; import org.gluu.oxtrust.exception.DuplicateEmailException; import org.gluu.oxtrust.model.Device; +import org.gluu.oxtrust.model.GluuBoolean; import org.gluu.oxtrust.model.GluuCustomAttribute; import org.gluu.oxtrust.model.GluuCustomPerson; import org.gluu.oxtrust.model.GluuFido2Device; @@ -565,9 +566,14 @@ public String save() throws Exception { for (GluuCustomAttribute customAttribute : customAttributes) { if (customAttribute.getName().equalsIgnoreCase("gluuStatus")) { customAttribute.setValue(gluuStatus); - break; } - + if (customAttribute.getName().equalsIgnoreCase("oxTrustActive")) { + if(gluuStatus.equalsIgnoreCase("active")) { + customAttribute.setBooleanValue(GluuBoolean.TRUE); + }else { + customAttribute.setBooleanValue(GluuBoolean.FALSE); + } + } } this.person.setCustomAttributes(customAttributeAction.getCustomAttributes()); this.person.getCustomAttributes().addAll(removedAttributes);