We can continue implementing another essential thing for our client and it is authentication and route handling. Our goals for this lesson are:
- Page that the registered user will be redirected to
- Save the token to localStorage
- Allow user to log out
- Protect routes that only authenticated or guest users can see
View for only authorized users
It is already known that in the future we will want to allow users edit vehicles, so let's create the src/views/Vehicles/IndexView.vue
component as a placeholder with the following content:...