Answer the question
In order to leave comments, you need to log in
How to fix data loading?
Hello everyone
I have a project on nuxtjs
I have an isAuth middleware that checks whether the user is authorized (that is, whether the data has arrived)
The data is stored in the store, in layout/default.vue, using the created hook I do dispatch('user') to send a request to get data
. What is the problem
? When I set middleware: 'isAuth' on any page and reload it, then I get a redirect to the main page (such a condition in the middleware)
If I go from the main page to the page where I have middleware: 'isAuth', then everything works fine
How can I fix this so that the middleware waits for the data to load?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question