Login logic moved from the controller to the userFactory class and implemented exceptions. Now need to do the same for register logic.