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

Commit ef51926

Browse files
committed
update 2faVerification endpoint
1 parent 272bc44 commit ef51926

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,10 @@ public ApiResponse update2faVerification(
16761676
if(credVerification.getEnabled() == null || !credVerification.getEnabled()) {
16771677
throw new APIRuntimeException(SC_BAD_REQUEST, "2FA is not enabled for user");
16781678
}
1679-
if(!credVerification.getVerified().equals(credential.getVerified())) {
1679+
// update only if it's true. We need to prevent changing verification status from true to false
1680+
// Otherwise 2fa will be skipped during the login flow.
1681+
// The only way to set verification to false is disabling the 2fa for that user.
1682+
if(credential.getVerified()) {
16801683
userDao.update2fa(credVerification.getId(), true, credential.getVerified());
16811684
}
16821685
return ApiResponseFactory.createResponse("User verification updated");

0 commit comments

Comments
 (0)