[英]Does Firebase's UI Auth connect with Realtime Database?
在學習 Firebase 的 UI Auth 之前,我想知道它是否做了以下事情:
我原以為擁有身份驗證系統的目的之一是它可以為用戶提供個性化的網站體驗。
例如,一旦登錄,用戶就會被添加到 Firebase 的實時數據庫中。 用戶的“名稱屬性”是它提供的用於注冊的屬性。 元素的內容包含消息:'Hello 'username'。
UI Auth 是否連接到 Firebase 的實時數據庫來執行此操作?
不,firebase不會做這樣的事情。您必須自己將用戶添加到實時數據庫中。 登錄后,您可以訪問用戶屬性,例如(用戶名和電子郵件)。 之后,您可以自由選擇如何管理您的用戶。
編輯:
//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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.