Add the following features to your app.
- Add a meta field named
authRequired
to each of your routes defined in router/index.js. Set the meta field totrue
only if the route should be accessed by a user who is logged in; otherwise set it tofalse
. - Add a global navigation guard which redirects a users to the home page if the route requires the user to be logged in and the user is not logged in.
- Add a route definition that redirects the user to your home page if the users attempts to navigate to a route that is not defined in router/index.js.