Made two mistakes. One I never checked if there where no users returned from the DB when logging the user. The other was that when I checked if the passwords match or not when creating an account I failed the process if the passwords matched.