updates for better support of username/email authentication