简体   繁体   English

Firebase 的 UI Auth 是否与实时数据库连接?

[英]Does Firebase's UI Auth connect with Realtime Database?

Before I learn Firebase's UI Auth, I want to know if it does the following:在学习 Firebase 的 UI Auth 之前,我想知道它是否做了以下事情:

I would've thought one purpose of having an authentication system was so that it could provide the user with a personalised experience of the website.我原以为拥有身份验证系统的目的之一是它可以为用户提供个性化的网站体验。

For instance, once signing in, the user is added to Firebase's Realtime Database.例如,一旦登录,用户就会被添加到 Firebase 的实时数据库中。 The user's 'name property' is the one it gives to sign up with.用户的“名称属性”是它提供的用于注册的属性。 An element's content contains the message: 'Hello 'username'.元素的内容包含消息:'Hello 'username'。

Does UI Auth connect to Firebase's Realtime Database to do this? UI Auth 是否连接到 Firebase 的实时数据库来执行此操作?

No,firebase does not do such a thing.You must add users to a realtime database by yourself.不,firebase不会做这样的事情。您必须自己将用户添加到实时数据库中。 Once signed in,you can access user properties for example(username and email).登录后,您可以访问用户属性,例如(用户名和电子邮件)。 After that,you have the freedom how do you want to manage your users.之后,您可以自由选择如何管理您的用户。


EDIT:编辑:

//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
                  */

                    
                });

Here is a link that might be helpful: https://firebase.google.com/docs/auth/web/manage-users这是一个可能有用的链接: https://firebase.google.com/docs/auth/web/manage-users

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM