Added user authentication and a user factory for test purposes