diff --git a/plugins/user-two-factor-authenticators/totp/src/main/java/org/apache/cloudstack/auth/TotpUserTwoFactorAuthenticator.java b/plugins/user-two-factor-authenticators/totp/src/main/java/org/apache/cloudstack/auth/TotpUserTwoFactorAuthenticator.java index c7c4997f1894..b722bd14393d 100644 --- a/plugins/user-two-factor-authenticators/totp/src/main/java/org/apache/cloudstack/auth/TotpUserTwoFactorAuthenticator.java +++ b/plugins/user-two-factor-authenticators/totp/src/main/java/org/apache/cloudstack/auth/TotpUserTwoFactorAuthenticator.java @@ -54,7 +54,9 @@ public void check2FA(String code, UserAccount userAccount) throws CloudTwoFactor logger.info("2FA matches user's input"); return; } - throw new CloudTwoFactorAuthenticationException("two-factor authentication code provided is invalid"); + String msg = "two-factor authentication code provided is invalid"; + logger.error(msg); + throw new CloudTwoFactorAuthenticationException(msg); } private String get2FAKey(UserAccount userAccount) {