我正在尝试流星和建立一个非常简单的应用程序。它有两个登录/注册方法: google和普通用户名/密码。
我的问题是用户名/密码登录类型。没有任何选项可以添加额外的配置文件字段,特别是“名称”。
使用谷歌注册的用户都有自己的名字,但使用电子邮件和密码注册的用户却没有。
我怎么才能解决这个问题?
发布于 2014-04-23 19:02:09
解决这个问题的最好方法是实现您自己的注册UI,而不是使用accounts-ui包进行注册。它的登录位采用了Meteor.user().profile.name的名称。您可以在使用手动创建帐户过程中填充此操作:
您可以使用这样的方式注册:
Accounts.createUser({
username: 'username_here',
password: 'password_here',
email: 'email_here',
profile: {
name: 'Name here'
}
}, function(err) {
if(!err) {
//Do something - the user is registered
}else{
alert(err.reason);
}
});您也许还可以使用accounts ui包登录,并使用CSS禁用注册链接。
#login-buttons #signup-link {
display: none;
}https://stackoverflow.com/questions/23252442
复制相似问题