Checking user authentication against database records