Register and log in user