Firebase Auth Tutorial #14 - Showing User Info

Firebase Auth Tutorial #14 - Showing User Info

Net Ninja

5 лет назад

52,596 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Hazem Khairy
Hazem Khairy - 11.05.2022 11:15

Shouldn't we unsubscribe the Database listener when logging out? . Assume the following scenario: within the same session, a user logs in, then logs out, then logs in. Does that mean we are having 2 listeners, one from each login?

Ответить
Shelly
Shelly - 30.11.2021 22:28

You are a saviour. Every time I pick up some new technology to learn you have got my back as always.

Ответить
Cynthia Heyman
Cynthia Heyman - 13.10.2021 20:07

thank you so much for these vidoes! I am building an application with Quasar and Firebase. I'm brand new to both of them, this video series is super easy to follow and makes so much sense!

Ответить
Julian GZR
Julian GZR - 23.03.2021 15:33

Hello , thank you for your course! i have a doubt, why did you get the "insufficient permissions" error when you logged out? shouldn't the user be null at that moment and not reach that part of the code?

Ответить
Tushar Ghadi
Tushar Ghadi - 28.12.2020 10:12

How to delete Guides? reply, please !!!!!!!!!!!!!How to delete Guides? reply, please !!!!!!!!!!!!!How to delete Guides? reply, please !!!!!!!!!!!!!How to delete Guides? reply, please !!!!!!!!!!!!!

How to delete Guides? reply, please !!!!!!!!!!!!!

Ответить
mansoor Latif
mansoor Latif - 14.11.2020 19:45

how to show user name plz help me?

Ответить
Kagisho Phahlamohlaka
Kagisho Phahlamohlaka - 05.06.2020 20:30

querySelectoooooorrrrr!!!!

Ответить
Jim Cumming
Jim Cumming - 12.02.2020 16:02

When you call the onSnapshot method, it returns an object that you can use to unsubscribe from the listener and prevent the error.


So if you change your onAuthStateHandler to the code below the error won't happen.



let unsubscribe = () => {};
// listen for auth changes
auth.onAuthStateChanged( user => {
if(user){
// get data
unsubscribe = db.collection('guides').onSnapshot(snapshot => {
setupGuides(snapshot.docs);
})
setupUi(user);
} else {
setupGuides([]);
setupUi();
unsubscribe();
}
});

Ответить
abin philip
abin philip - 18.12.2019 16:54

Thanks Shaun

Ответить
Purwanti Riri
Purwanti Riri - 30.10.2019 15:49

big thank bro

Ответить
Ramon Sanchez
Ramon Sanchez - 03.09.2019 20:50

Did you ever notice that when the Net Ninja is typing "querySelector" he sings the "Selector" part? It's not a criticism, it's just interesting what some people do.

Ответить
Monil Dand
Monil Dand - 26.08.2019 22:21

now catch is not used callback function for error is used.
db.collection("cities")
.onSnapshot(function(snapshot) {
//...
}, function(error) {
//...
});

Ответить
BiggMurr
BiggMurr - 20.01.2019 09:55

You have done it again! Yet another perfect explanation and process of some great code. For that, I thank you.

Ответить
Chon Hee Cho
Chon Hee Cho - 18.01.2019 05:31

Awesome! I also learned from you how I can handle the error. Thank you very much:)

Ответить
나 개발 한 번 해보려고
나 개발 한 번 해보려고 - 17.01.2019 13:11

Thank you! I entered the following code.
db.collection('guides').onSnapshot(snapshot => {......}).catch(err => { console.log(err.message); }).

And I received TypeError message. "TypeError: db.collection(...).onSnapshot(...).catch is not a function at Object.auth.onAuthStateChanged.user"

So how to correct it?? ^^

Ответить
Erickson Suero
Erickson Suero - 16.01.2019 13:58

Thanks you Shaun very good tut!...

Ответить