Completed database work in auth.php for current functions