Updated code to handle user creation and sign up using invite code,