ali-bouali / spring-boot-3-jwt-security

Sample project on how to implement JWT security based using Spring boot 3 and Spring security 6
https://aliboucoding.com/p/securing-your-spring-boot-3-0-applications-with-json-web-tokens-jwt
Apache License 2.0
1.86k stars 870 forks source link

Prevent creation of multiple users with the same email #63

Open leonleoff opened 10 months ago

leonleoff commented 10 months ago

Implemented a unique constraint on the email field within the User entity to prevent the registration of multiple users with the same email. This is essential as the authentication process relies on the findByEmail method, which must only find one user per email, ensuring integrity in authentication.

nekitbr commented 9 months ago

up

I'll need to bookmark this repo, because it's getting a lot of PRs recently, and I didn't know about this one. In the past, I've created my custom beans just to make this check easier, directly on the request DTO, good to know!