Checks the login credentials