Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isDirty(), hasChanged() fails with Spring Security and MongoDB #763

Open
pangeaos opened this issue Jun 4, 2022 · 0 comments
Open

isDirty(), hasChanged() fails with Spring Security and MongoDB #763

pangeaos opened this issue Jun 4, 2022 · 0 comments

Comments

@pangeaos
Copy link

pangeaos commented Jun 4, 2022

Expected Behavior

If there is NO any update property on the User object when it's saving, then the isDirty() function should work as expected. The UserPasswordEncoderListener.class should prevent any enconding password.

Actual Behaviour

The isDirty() function is not working on the UserPasswordEncoderListener.class, every time I save a user object that has NO updates always return true, causing an already encoded password to be re-encoded and thereby breaking authentication.

User Controller
In the UserController, testing the isDirty function worked as expected.
Screen Shot 2022-06-03 at 8 53 50 PM

UserPasswordEncoderListener.class
In the class doesn't work.
Screen Shot 2022-06-03 at 8 54 03 PM

You can check the logs.
Screen Shot 2022-06-03 at 8 54 11 PM

Any idea?

Steps To Reproduce

No response

Environment Information

  • Mac OS X

  • openjdk version "11.0.14.1" 2022-02-08 LTS

  • OpenJDK Runtime Environment Corretto-11.0.14.10.1 (build 11.0.14.1+10-LTS)

  • OpenJDK 64-Bit Server VM Corretto-11.0.14.10.1 (build 11.0.14.1+10-LTS, mixed mode)

  • MongoDB

  • Spring Security Core Plugin

Example Application

No response

Version

5.1.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant