Skip to content

Commit

Permalink
Merge pull request #52 from Batch-697-Adam-Ranieri/khairston-patch-1
Browse files Browse the repository at this point in the history
login function returns null if username cannot be found
  • Loading branch information
rhtydv authored Mar 5, 2020
2 parents 0f57702 + 01c56f8 commit 034a04e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/com/revature/services/EmployeeServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ public List<Employee> getActiveDrivers() {
@Override
public Employee loginEmployee(String username, String password) {
Employee e = er.findByUsername(username);
if (e.getPassword().equals(password)) {
if (e == null) {
return null;
}
else if (e.getPassword().equals(password)) {
return e;
}
else return null;

return null;
// StrongPasswordEncryptor passwordEncryptor = new StrongPasswordEncryptor();

// if (passwordEncryptor.checkPassword(password, e.getPassword())) {
Expand Down

0 comments on commit 034a04e

Please sign in to comment.