Answer the question
In order to leave comments, you need to log in
How to get currentUser in Vue?
Hello. Tell. Through middleware I want to see the currentUser from Firebase. For now, just look, then I will use it to protect routes.
The problem is that user is always null. Even though I'm logged in.
Alternatively, maybe I’ll say something stupid and I’m wrong, but this is due to the fact that the middleware is loaded ahead of the rest and does not yet receive the currentUser state. And then how to be? Or maybe another reason?
Since I still use Vuex, I tried to check by getter from store. But in fact, everything is the same ...
For fun, I tried it through a timeout - also to no avail ...
Answer the question
In order to leave comments, you need to log in
Won or not? I have a similar problem, only I have already created a rule for the router. I store the user in the state, when the page is updated it is null, the rule is triggered, then it is no longer null, the menu from the App is loaded and the registration hangs in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question