在学习Firebase的UI Auth之前,我想知道它是否做了以下工作:
我本以为拥有一个认证系统的目的之一是让它能够为用户提供网站的个性化体验。
例如,一旦登录,用户将被添加到Firebase的实时数据库中。用户的“name属性”是它提供的注册对象。元素的内容包含消息:'Hello 'username‘。
UI Auth是否连接到Firebase的实时数据库以完成此操作?
发布于 2020-10-24 16:02:11
不,firebase不这样做,thing.You必须自己将用户添加到实时数据库中。一旦登录,您可以访问用户属性,例如(用户名和电子邮件)。在此之后,您可以自由地管理您的用户。
编辑:
//you initialize app with fierebase config
app.initializeApp(firebaseConfig);
this.auth=app.auth();
//this line return a Promise
this.auth.signInWithEmailAndPassword(email,password).then(
authUser=>{ /*
Here you add user to firebase
you want to use authUser.user.id as document id
You also can access email and password
*/
});下面是一个可能有用的链接:https://firebase.google.com/docs/auth/web/manage-users
https://stackoverflow.com/questions/64515312
复制相似问题