How to Displaying logged email in firebase? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 12

How to Displaying logged email in firebase?

I have the code right here: But how to display ALL the created account?

12th Feb 2019, 1:17 PM
Jingga Sona
Jingga Sona - avatar
5 Answers
+ 9
Interesting question. Let me try before Burey or Martin answers your question. 1. If users data are general data, the way is something similar to this : const getInfo = () => { read("users", data=>{ for(let email in data.val()) { document.body.innerHTML += "<br/>"+ email; } }); }; But not sure, I checked Martin's script on Dropbox and made some edits based on guessing. Seems it works only if you upload the user data in specific format : "email/"+email+"pass/"+pass; 2. For the auth() methods, let me try to dig into the firebase doc 😋 Reference: Seems there is a getCurrentUser() method, but no method for client to see all registered email (otherwise too malicious, isn't it?)
12th Feb 2019, 2:05 PM
Gordon - avatar
+ 8
You cannot just display all accounts only using auth as far as I know, you would need to store the data you want using firebase database. And the just query it, like Gordon said. auth.createUserWithEmailAndPassword(email, password).then(function() { firebase.database.ref("Users/"+auth.currentUser.uid).set({ email: email, // or whatever data you want to store }); When all is stored you can just call firebase.database.ref("Users").once(function(v) { for(var uid in v.val()) console.log(JSON.stringify(v.val()[uid],nulll,4); }); -> I had a code doing the exact same thing but I deleted it sorry 😅
12th Feb 2019, 2:17 PM
Martin Möhle
Martin Möhle - avatar
+ 6
Looks like people are going crazy with firebase !! Was also finding this one!
13th Feb 2019, 7:04 AM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
+ 3
Wach this video from A-Z Explain how !
13th Feb 2019, 4:25 AM
Omar Khalil Bakhsh
Omar Khalil Bakhsh - avatar
+ 1
13th Feb 2019, 2:50 AM
Md Rana
Md Rana - avatar