aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/model
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-11-19 10:27:44 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-11-19 10:27:44 +1300
commita0246954d9d9f248183563d25fad1f2ff2f78b08 (patch)
treece6f913a9dd9878cb514995e34275bad75558d9e /src/org/traccar/model
parentb0aa4698e95658f57ec2d3e0ed4f3fe0db8500a2 (diff)
downloadtrackermap-server-a0246954d9d9f248183563d25fad1f2ff2f78b08.tar.gz
trackermap-server-a0246954d9d9f248183563d25fad1f2ff2f78b08.tar.bz2
trackermap-server-a0246954d9d9f248183563d25fad1f2ff2f78b08.zip
Small adjustments to tokens
Diffstat (limited to 'src/org/traccar/model')
-rw-r--r--src/org/traccar/model/User.java4
1 files changed, 3 insertions, 1 deletions
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;
}
}