Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • I assume you use OTPs for password reset flow? You send it to user by email or something? If so, then all you need to do is create a connection between the OTP and email, and add "getUserByEmail" to UserRepository. That's the cleanest solution IMO. I don't see any reason to couple OtpService with user data. Commented Nov 5 at 20:25
  • What does the password reset flow look like from a users perspective? Once the OtpService has validated the OTP, how does the system know what to do next? What is the essential difference between your first two options? Commented Nov 6 at 8:21