Answer the question
In order to leave comments, you need to log in
How to show error page on condition after validation in middleware?
I can’t understand a little how middleware works in NUXT.
Namely, after checking, for example, how can I show the error page (which I have in layouts\error.vue), passing it to error -> statusCode?
I see from the examples that everyone does only a redirect.
Now I have some kind of nonsense. I store the http code in the store and use it to display content (200 - successful, or other types of errors) and in the middleware, if the check fails, I change the store to 4 ** code.
But somehow it doesn't seem right to me.
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