FirebaseUI React:允许用户通过电子邮件和密码进行注册,而无需提供其名字/姓氏 [英] FirebaseUI React: allow user to sign up via email+password without providing their first/last name

查看:82
本文介绍了FirebaseUI React:允许用户通过电子邮件和密码进行注册,而无需提供其名字/姓氏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用FirebaseUI React auth组件,因此用户可以通过电子邮件+密码登录.

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.

我不希望用户在注册时提供此信息.如何自定义组件以从注册流程中删除输入的名称?

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?

推荐答案

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());
}

这篇关于FirebaseUI React:允许用户通过电子邮件和密码进行注册,而无需提供其名字/姓氏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆