From 43e5024676346a75600250e5d879e3eb38073166 Mon Sep 17 00:00:00 2001 From: Virtually Nick Date: Fri, 3 Apr 2020 13:16:53 -0400 Subject: [PATCH] GUACAMOLE-770: Regenerate code when field is empty. --- .../guacamole/auth/totp/user/UserVerificationService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/UserVerificationService.java b/extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/UserVerificationService.java index 2414ee872..59e5a7126 100644 --- a/extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/UserVerificationService.java +++ b/extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/UserVerificationService.java @@ -108,7 +108,7 @@ public class UserVerificationService { // If no key is defined, attempt to generate a new key String secret = attributes.get(TOTPUser.TOTP_KEY_SECRET_ATTRIBUTE_NAME); - if (secret == null) { + if (secret == null || secret.isEmpty()) { // Generate random key for user TOTPGenerator.Mode mode = confService.getMode();