Skip to content

Commit

Permalink
Merge pull request #2387 from GluuFederation/master_issues_2378
Browse files Browse the repository at this point in the history
feat(oxtrust=server): #2378 sync gluuStatus with oxTrustActive attribute
  • Loading branch information
yurem authored Nov 3, 2023
2 parents 4f6ab84 + 2a46967 commit 2bdf983
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 2bdf983

Please sign in to comment.