Handling Authentication In Vue Using Vuex
Traditionally, many people use local storage to manage tokens generated through client-side authentication. A big concern is always a better way to manage authorization tokens to allow us to store even more information on users.
This is where Vuex comes in. Vuex manages states for Vue.js applications. It serves as a centralized store for all the components in an application, with rules ensuring that the state can only be mutated in a predictable fashion.
Sounds like a better alternative to always checking localStorage? Let’s explore it.
Prerequisites
Knowledge of JavaScript
Node installed on your local system
Knowledge of Vue
Have Vue CLI installed
Have read Vue Authentication And Route Handling Using Vue-router ― Scotch
Setting up the application modules
For this project, we want to creat...