Bug fixed. There was a typo in the query that finds the user and the password. Works flawlessly now