Refactored user login check in prep for controller tests