In this lesson, we use middleware to redirect anonymous users away from protected pages and redirect logged in users away from the login and register pages.
It is important to remember that we are working in an SPA. In such an environment, middleware isn’t truly a security feature but rather a UX feature. True security comes from limiting what data is sent back from the REST API.
Links