FirebaseUI React: allow user to sign up via email+password without providing their first/last name

ε祈祈猫儿з 提交于 2020-08-20 04:57:24

问题


I am using the FirebaseUI React auth component so users can log in via email + password.

const uiConfig = {
  signInFlow: 'popup',
  signInOptions: [
    firebase.auth.EmailAuthProvider.EMAIL_PASSWORD_SIGN_IN_METHOD,
  ]
};

....

<FirebaseAuth uiConfig={uiConfig} firebaseAuth={firebase.auth()}/>

However, the registration form wants the user's first and last name.

Screenshot of the FirebaseUI email+password login

I don't want the user to provide this information at the time of registration. How do I customize the component to remove the name input from the registration flow?


回答1:


The setRequireName method seems to allow for this. Here is an example of the FirebaseUI demo application using setRequireName to enable/disable this UI element:

if (mUseEmailProvider.isChecked()) {
    selectedProviders.add(new IdpConfig.EmailBuilder()
            .setRequireName(mRequireName.isChecked())
            .setAllowNewAccounts(mAllowNewEmailAccounts.isChecked())
            .build());
}


来源:https://stackoverflow.com/questions/61513969/firebaseui-react-allow-user-to-sign-up-via-emailpassword-without-providing-the

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!