Skip to content

Commit

Permalink
Merge pull request traccar#3445 from tsmgeek/login_auth_trim
Browse files Browse the repository at this point in the history
Trim email field on auth
  • Loading branch information
tananaev authored Aug 15, 2017
2 parents 8012240 + b2c8c67 commit 5606c72
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/org/traccar/database/DataManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ private void initDatabaseSchema() throws SQLException, LiquibaseException {

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;
Expand Down
2 changes: 1 addition & 1 deletion src/org/traccar/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public String getEmail() {
}

public void setEmail(String email) {
this.email = email;
this.email = email.trim();
}

private String phone;
Expand Down

0 comments on commit 5606c72

Please sign in to comment.