aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/traccar/api/security/LoginService.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/api/security/LoginService.java b/src/main/java/org/traccar/api/security/LoginService.java
index 8eb5537fa..829f5d2fa 100644
--- a/src/main/java/org/traccar/api/security/LoginService.java
+++ b/src/main/java/org/traccar/api/security/LoginService.java
@@ -127,7 +127,7 @@ public class LoginService {
private void checkUserCode(User user, Integer code) throws SecurityException {
String key = user.getTotpKey();
- if (key != null) {
+ if (key != null && !key.isEmpty()) {
if (code == null) {
throw new CodeRequiredException();
}