Skip to content
Advertisement

How to check the user’s verification code?

I am very new to Spring Boot. This is what I want to do: The user’s email is test@example.com. That user already exists in my database, but I would like to know if their verificationCode is 123.

Entity:

JavaScript

So with userRepository.findByEmail("test@example.com") I am getting the correct user, but how do I check their verification code?

Advertisement

Answer

if you’re using userRepository.findByEmail(“test@example.com”), just take the verification code from entity.

JavaScript

Another option to have it within query.

JavaScript

Or you can have something similar as Philipp wrote, but I would not get whole entity just find out if it exist. So solution would be

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement