refactored user auth in angular app run