started the authentication

basic routing
This commit is contained in:
Torben Indorf
2020-02-09 09:48:43 +01:00
parent d07dc6e8a6
commit e2568a1bbe
19 changed files with 326 additions and 61 deletions
+30
View File
@@ -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
}
}
});