Getting an error when using and authentication for password with mysql

My database is correctly linked because when I input a wrong username is shows me wrong username and when I input a correct username and no password it gives me the error in the following text file - “Index 2 out of bounds for length 2” however I dont have any loops and have no idea which indexing it has an issue with

This is the first code snippet it is showing an error on

Person person = personRepository.getByUsername(name);

This is the second code snippet it is showing an error on

 try {
                        authService.authenticate(name.getValue(), password.getValue());
                        UI.getCurrent().navigate("");
                    } catch (AuthService.AuthException e) {
                    }```

```Java
@Entity
@Table(name = "logintable")
public class Person extends AbstractEntity {

    @Column(name = "username")
    private String username;
    @Column(name = "firstname")
    private String firstname;
    @Column(name = "lastname")
    private String lastname;
    @Column(name = "role")
    private Role role;
    @Column(name = "passwordsalt")
    private String passwordSalt;
    @Column(name = "passwordhash")
    private String passwordHash;
    private String activationCode;
    private boolean active;

    public Person() {
    }

    public Person(String firstname, String lastname, String username, String password, Role role) {
        this.firstname = firstname;
        this.lastname = lastname;
        this.role = role;
        this.username = username;
        this.passwordSalt = RandomStringUtils.random(32);
        this.passwordHash = DigestUtils.sha1Hex(password + passwordSalt);
        this.activationCode = RandomStringUtils.randomAlphanumeric(32);
    }
    
    [Getters and Setters down here]

message.txt (23.1 KB)

This code is for login

What does your AuthService look like? Do you have any custom queries in the repository?