authentication.createTempUser and fixes to properly handle new users