Skip to content

Commit

Permalink
add 2fa status field to admin lookup (#7182)
Browse files Browse the repository at this point in the history
  • Loading branch information
auumgn authored Jan 16, 2025
1 parent d7866ed commit be610a6
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public class AdminController extends BaseController {
private static final String DEACTIVATED = "(deactivated)";
private static final String DEPRECATED = "(deprecated)";
private static final String UNCLAIMED = "(unclaimed)";
private static final String ENABLED_2FA = "2FAEnabled";
private static final String INP_STRING_SEPARATOR = " \n\r\t,";
private static final String OUT_EMAIL_PRIMARY = "*";
private static final String OUT_STRING_SEPARATOR = " ";
Expand Down Expand Up @@ -440,6 +441,11 @@ else if (PojoUtil.isEmpty(email) || !validateEmailAddress(email))
}
}

boolean twoFactorAuthenticationEnabled = twoFactorAuthenticationManager.userUsing2FA(orcid);
if (twoFactorAuthenticationEnabled) {
builder.append(OUT_STRING_SEPARATOR).append(ENABLED_2FA);
}

} else {
if (isOrcid) {
builder.append(orcid).append(OUT_STRING_SEPARATOR).append(OUT_NOT_AVAILABLE);
Expand Down

0 comments on commit be610a6

Please sign in to comment.