From a0246954d9d9f248183563d25fad1f2ff2f78b08 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 19 Nov 2016 10:27:44 +1300 Subject: Small adjustments to tokens --- src/org/traccar/model/User.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/org/traccar/model') diff --git a/src/org/traccar/model/User.java b/src/org/traccar/model/User.java index aa24b795e..411b556fc 100644 --- a/src/org/traccar/model/User.java +++ b/src/org/traccar/model/User.java @@ -187,11 +187,13 @@ public class User extends Extensible { } public void setToken(String token) { - if (token != null && !token.isEmpty()) { + if (token != null) { if (!token.matches("^[a-zA-Z0-9]{16,}$")) { throw new IllegalArgumentException("Illegal token"); } this.token = token; + } else { + this.token = null; } } -- cgit v1.2.3