Skip to content

Conversation

OlehRidchenko
Copy link

and created AuthenticationService, imlp methods register and login with custom exceptions

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Decision: APPROVE

Your implementation meets the core requirements and follows the checklist:

  • User model includes email, password, salt, with email unique and sensitive fields excluded from toString().
  • DAO and Service layers have correct method signatures; findByEmail returns Optional<User> and uses uniqueResultOptional() in the DAO.
  • Password salting and hashing happen in UserServiceImpl.add using HashUtil, which has a private constructor as required.
  • AuthenticationServiceImpl uses UserService (not DAO), combines login checks into a single condition, and Main retrieves the service via the injector and calls register/login.

Minor, non-blocking suggestions to strengthen your solution:

  • In AuthenticationServiceImpl.register, return the result of userService.add(user) directly to ensure any generated fields (e.g., id) are reflected.
  • Add basic input validation for null/empty email/password in login and register; throw the relevant checked exceptions with clear messages.
  • In HashUtil.getHashPassword, use StandardCharsets.UTF_8 for deterministic hashing.
  • Consider renaming register parameter from login to email for consistency.

Great work aligning with the requirements and demonstrating clean separation of concerns. Keep it up!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

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

Successfully merging this pull request may close these issues.

2 participants