From 3d1c64a4564a88239ec9837c1b0ac9367023fb64 Mon Sep 17 00:00:00 2001 From: tsmgeek Date: Mon, 14 Aug 2017 22:36:32 +0100 Subject: Trim/Lowercase email address used for auth --- src/org/traccar/database/DataManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index b7d3cb1e4..d5b4dd617 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().toLowerCase()) .executeQuerySingle(User.class); if (user != null && user.isPasswordValid(password)) { return user; -- cgit v1.2.3 From 5f0d1137eb8402060bd655c58addf6c2646b2bce Mon Sep 17 00:00:00 2001 From: tsmgeek Date: Mon, 14 Aug 2017 22:38:59 +0100 Subject: Trim email address --- src/org/traccar/model/User.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3 From b2c8c6795f0e0c9265fa1c5db30ddd0bebfcc081 Mon Sep 17 00:00:00 2001 From: tsmgeek Date: Mon, 14 Aug 2017 23:06:45 +0100 Subject: Update DataManager.java --- src/org/traccar/database/DataManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index d5b4dd617..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.trim().toLowerCase()) + .setString("email", email.trim()) .executeQuerySingle(User.class); if (user != null && user.isPasswordValid(password)) { return user; -- cgit v1.2.3