Skip to content

Commit

Permalink
feat(oxtrust=server): #2378 sync gluuStatus with oxTrustActive attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhar16 committed Nov 3, 2023
1 parent 4f6ab84 commit 2a46967
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 2a46967

Please sign in to comment.