started the authentication
basic routing
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import Vue from 'vue';
|
||||
import Vuex from 'vuex';
|
||||
import VuexPersistence from 'vuex-persist';
|
||||
import authStore from "@/store/auth.store";
|
||||
|
||||
Vue.use(Vuex);
|
||||
// set up persistence storage plugin
|
||||
const vuexPersistence = new VuexPersistence({
|
||||
key: process.env.VUE_APP_TITLE,
|
||||
storage: window.localStorage,
|
||||
reducer: (state: any) => ({
|
||||
auth: {
|
||||
token: state.auth.token,
|
||||
user: state.auth.user
|
||||
}
|
||||
}),
|
||||
filter: (mutation) => ['auth/saveLogin'].includes(mutation.type)
|
||||
});
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {},
|
||||
mutations: {},
|
||||
actions: {},
|
||||
modules: {
|
||||
auth: {
|
||||
namespaced: true,
|
||||
...authStore
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user