Class UserSignIn

java.lang.Object
application.user.UserSignIn

public class UserSignIn extends Object
The UserSignIn class handles the process of user authentication. It verifies the input credentials (login and password) against the stored user data. The password is validated through hashing and comparison with the stored hash.
  • Constructor Details

    • UserSignIn

      public UserSignIn(PasswordHasher hasher, UserRepository repo)
      Constructs a UserSignIn instance responsible for user authentication. It handles the process of verifying user credentials by comparing the provided input with stored data in the repository and validating the password through hashing.
      Parameters:
      hasher - a PasswordHasher implementation used to hash and validate user passwords.
      repo - a UserRepository implementation that stores user authentication data.
  • Method Details

    • execute

      public User execute(String login, String password)
      Execute methods, that takes in inputted login and password. Checks via UserRepository if login exists in database. Compares hashed input password with hashed password in database.
      Parameters:
      login - inputted login by user
      password - inputted password by user
      Returns:
      user object, if it exists.