From 38bea83f8d52675b1d211d972ac419fb208d198b Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 2 Nov 2023 07:01:44 -0700 Subject: Handle empty TOTP field --- src/main/java/org/traccar/api/security/LoginService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main') 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(); } -- cgit v1.2.3