Answer the question
In order to leave comments, you need to log in
SPA on Laravel and vuejs - how to use middleware?
This is my first time writing spa, and I have such a question - what is the analogue of middleware from Laravel in vuejs?
I have 2 types of users and each has access to certain pages. And authorized users generally should have access only to the main one.
Are there any components that solve the problem with access to different pages? Or how is it done?
Answer the question
In order to leave comments, you need to log in
For such a task, it is not necessary to use any library. You can use vue-router hooks and write anything in them, including access.
I believe that the definition of viewing rights must be implemented only on the server. Why would Vue-app need to know anything about this? Just when you click on a link that is not available to an unauthorized user, you need to notify that in order to view this page you need to log in and slip the form
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question