Fix 2FA becoming enabled when the user inputs the wrong code during setup (#7972)

This commit is contained in:
Fabricio Duarte 2023-09-26 03:59:11 -03:00 committed by GitHub
parent 951ba04cf0
commit ef742210b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -3259,7 +3259,7 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
_userDetailsDao.update(userDetailVO.getId(), userDetailVO);
}
} catch (CloudTwoFactorAuthenticationException e) {
UserDetailVO userDetailVO = _userDetailsDao.findDetail(userAccountId, "2FAsetupComplete");
UserDetailVO userDetailVO = _userDetailsDao.findDetail(userAccountId, UserDetailVO.Setup2FADetail);
if (userDetailVO != null && userDetailVO.getValue().equals(UserAccountVO.Setup2FAstatus.ENABLED.name())) {
disableTwoFactorAuthentication(userAccountId, caller, owner);
}