Moved log in functions to UserRepo