+ 12

How to Displaying logged email in firebase?

I have the code right here: https://code.sololearn.com/W4Ul2lDAsbP7/?ref=app But how to display ALL the created account?

12th Feb 2019, 1:17 PM
Jingga Sona
Jingga Sona - avatar
5 odpowiedzi
+ 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: https://firebase.google.com/docs/auth/android/password-auth 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
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 ! https://youtu.be/iKlWaUszxB4
13th Feb 2019, 4:25 AM
Omar Khalil Bakhsh
Omar Khalil Bakhsh - avatar
+ 1
nice
13th Feb 2019, 2:50 AM
Md Rana
Md Rana - avatar