Raysmond / SpringBlog

A simple blogging system implemented with Spring Boot + Hibernate + MySQL + Bootstrap4.
http://raysmond.com
BSD 3-Clause "New" or "Revised" License
1.64k stars 695 forks source link

fix a bug for changing password #11

Closed n0sky closed 8 years ago

n0sky commented 8 years ago

user.getPassword().equals(passwordEncoder.encode(password)) doesn't get a right boolean value to execute user.setPassword(passwordEncoder.encode(newPassword)) correctly aiming to change password. Though not knowing why, passwordEncoder.matches method works after several attempts to debug.

Raysmond commented 8 years ago

Good job. Yeah, matches function is the right way to do it.