【发布时间】:2018-10-06 04:39:11
【问题描述】:
我想用电子邮件和密码创建一个用户更多其他数据,例如姓名 在我的界面中,我有这个:
export interface UserInterface {
id?: string;
name: string;
email: string;
password: string;
status: string
constructor(auth) {
this.id = auth.uid
}
}
我的服务:
createUser(user: UserInterface) {
return this.angularFireAuth.auth.createUserWithEmailAndPassword(user.email, user.password)
}
如何在 ID 中添加属性名称和 uid?
【问题讨论】:
-
不,您不能使用此方法添加更多数据!火力基地负责 UID 和安全性
-
你应该把额外的数据放在数据库中,而不是在身份验证系统中。当用户注册时,创建 auth 用户并获取新的 uid,然后在您想要的任何路径下将附加字段写入数据库,例如
/user_profiles/{uid}。 -
所以,我不想将数据放入身份验证系统,我想要将身份验证系统与数据库关联
标签: typescript firebase firebase-authentication angular5