aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-08-15 16:46:38 +1200
committerGitHub <noreply@github.com>2017-08-15 16:46:38 +1200
commit5606c72b19568ddf50e2fa35f35e05358bb671e4 (patch)
tree26661fc5e5959e0d4abd01959cdb4210c91cb60d /src/org
parent8012240ac5662d8b0a2ec7907ad3f04e86b17627 (diff)
parentb2c8c6795f0e0c9265fa1c5db30ddd0bebfcc081 (diff)
downloadtrackermap-server-5606c72b19568ddf50e2fa35f35e05358bb671e4.tar.gz
trackermap-server-5606c72b19568ddf50e2fa35f35e05358bb671e4.tar.bz2
trackermap-server-5606c72b19568ddf50e2fa35f35e05358bb671e4.zip
Merge pull request #3445 from tsmgeek/login_auth_trim
Trim email field on auth
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/database/DataManager.java2
-rw-r--r--src/org/traccar/model/User.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java
index b7d3cb1e4..2e3e68bc9 100644
--- a/src/org/traccar/database/DataManager.java
+++ b/src/org/traccar/database/DataManager.java
@@ -297,7 +297,7 @@ public class DataManager {
public User login(String email, String password) throws SQLException {
User user = QueryBuilder.create(dataSource, getQuery("database.loginUser"))
- .setString("email", email)
+ .setString("email", email.trim())
.executeQuerySingle(User.class);
if (user != null && user.isPasswordValid(password)) {
return user;
diff --git a/src/org/traccar/model/User.java b/src/org/traccar/model/User.java
index b71666f87..3557521ab 100644
--- a/src/org/traccar/model/User.java
+++ b/src/org/traccar/model/User.java
@@ -43,7 +43,7 @@ public class User extends ExtendedModel {
}
public void setEmail(String email) {
- this.email = email;
+ this.email = email.trim();
}
private String phone;