Skip to content

Commit 3fbcae1

Browse files
committed
fix a bug for changing password
1 parent f5e9927 commit 3fbcae1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/raysmond/blog/services/UserService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ public boolean changePassword(User user, String password, String newPassword){
7474
return false;
7575

7676
logger.info("" + passwordEncoder.matches(password, user.getPassword()));
77-
if (!user.getPassword().equals(passwordEncoder.encode(password)))
77+
boolean match = passwordEncoder.matches(password, user.getPassword());
78+
if (!match)
7879
return false;
7980

8081
user.setPassword(passwordEncoder.encode(newPassword));

0 commit comments

Comments
 (0)