Remove old storage

This commit is contained in:
Dane Everitt 2018-06-06 22:18:43 -07:00
parent a6441169b1
commit 871147f2d9
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
1 changed files with 0 additions and 38 deletions

View File

@ -1,38 +0,0 @@
import { User } from './models/user';
export const storeData = {
state: {
user: null,
},
actions: {
login: function ({ commit }) {
commit('login');
},
logout: function ({ commit }) {
commit('logout');
},
},
getters: {
getCurrentUser: function (state) {
if (!(state.user instanceof User)) {
state.user = User.fromJWT(localStorage.getItem('token'));
}
return state.user;
},
},
mutations: {
/**
* Log in a user and store them in vuex using the local storage token.
*
* @param state
*/
login: function (state) {
state.user = User.fromJWT(localStorage.getItem('token'));
},
logout: function (state) {
console.log('logout');
state.user = null;
}
}
};