From a759f756a7bd788fd17740438867c02a16386840 Mon Sep 17 00:00:00 2001 From: Guillaume Vincent Date: Mon, 10 Oct 2016 21:08:12 +0200 Subject: [PATCH] remove passwords in store --- src/components/PasswordGenerator.vue | 1 - src/store.js | 11 ++--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/components/PasswordGenerator.vue b/src/components/PasswordGenerator.vue index d377776..7bd9f16 100644 --- a/src/components/PasswordGenerator.vue +++ b/src/components/PasswordGenerator.vue @@ -215,7 +215,6 @@ fetchPasswords(){ Passwords.all().then(response => { this.passwords = response.data.results; - this.$store.dispatch('setPasswords', response.data.results); }); }, fetchPassword(id){ diff --git a/src/store.js b/src/store.js index 722ff24..8197df6 100644 --- a/src/store.js +++ b/src/store.js @@ -10,17 +10,12 @@ const auth = new Auth(storage); const state = { authenticated: auth.isAuthenticated(), - email: '', - passwords: [] + email: '' }; const mutations = { - setPasswords(state, passwords){ - state.passwords = passwords - }, logout(state){ state.authenticated = false; - state.passwords = []; }, userAuthenticated(state, user){ state.authenticated = true; @@ -33,14 +28,12 @@ const actions = { logout: ({commit}) => { auth.logout(); commit('logout'); - }, - setPasswords: ({commit}, password) => commit('setPasswords', password), + } }; const getters = { isAuthenticated: state => state.authenticated, isGuest: state => !state.authenticated, - passwords: state => state.passwords, email: state => state.email, baseURL: state => state.baseURL };