Skip to content
This repository was archived by the owner on Dec 9, 2025. It is now read-only.

Commit c12fd6f

Browse files
committed
add mfa to roles endpoint
1 parent 8e62c8f commit c12fd6f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main/java/com/appirio/tech/core/service/identity/dao/UserDAO.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,10 @@ public abstract class UserDAO implements DaoBase<User>, Transactional<UserDAO> {
171171
@RegisterMapperFactory(TCBeanMapperFactory.class)
172172
@SqlQuery(
173173
"SELECT " + USER_COLUMNS + ", " +
174-
"e.address AS email, e.status_id AS emailStatus " +
174+
"e.address AS email, e.status_id AS emailStatus, " +
175+
"mfa.enabled AS mfaEnabled, mfa.verified AS mfaVerified " +
175176
"FROM common_oltp.user AS u JOIN common_oltp.email AS e ON e.user_id = u.user_id " +
177+
"LEFT JOIN common_oltp.user_2fa AS mfa ON mfa.user_id = u.user_id " +
176178
"WHERE e.address = :email"
177179
)
178180
public abstract List<User> findUsersByEmailCS(@Bind("email") String email);

src/main/java/com/appirio/tech/core/service/identity/resource/UserResource.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,8 +1513,6 @@ public ApiResponse updateUser2fa(
15131513
@Valid PostPutRequest<User2fa> postRequest,
15141514
@Context HttpServletRequest request) {
15151515

1516-
logger.info(String.format("update user 2fa(%s)", resourceId));
1517-
15181516
TCID id = new TCID(resourceId);
15191517
validateResourceIdAndCheckPermission(authUser, id, user2faFactory.getUpdateScopes());
15201518
// checking param
@@ -1525,6 +1523,7 @@ public ApiResponse updateUser2fa(
15251523
if(user2fa.getEnabled() == null) {
15261524
throw new APIRuntimeException(SC_BAD_REQUEST, String.format(MSG_TEMPLATE_MANDATORY, "enabled"));
15271525
}
1526+
logger.info(String.format("update user 2fa(%s) - %b", resourceId, user2fa.getEnabled()));
15281527

15291528
Long userId = Utils.toLongValue(id);
15301529

0 commit comments

Comments
 (0)