Skip to content

Commit

Permalink
fix a bug for changing password
Browse files Browse the repository at this point in the history
  • Loading branch information
n0sky committed Sep 10, 2016
1 parent f5e9927 commit 3fbcae1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/raysmond/blog/services/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public boolean changePassword(User user, String password, String newPassword){
return false;

logger.info("" + passwordEncoder.matches(password, user.getPassword()));
if (!user.getPassword().equals(passwordEncoder.encode(password)))
boolean match = passwordEncoder.matches(password, user.getPassword());
if (!match)
return false;

user.setPassword(passwordEncoder.encode(newPassword));
Expand Down

0 comments on commit 3fbcae1

Please sign in to comment.