@@ -142,17 +142,17 @@ | |||||
numbers: true, | numbers: true, | ||||
symbols: true, | symbols: true, | ||||
length: 12, | length: 12, | ||||
counter: 1, | |||||
counter: 1 | |||||
} | } | ||||
}, | }, | ||||
masterPassword: '', | masterPassword: '', | ||||
encryptedLogin: '', | encryptedLogin: '', | ||||
generatedPassword: '', | |||||
generatedPassword: '' | |||||
} | } | ||||
}, | }, | ||||
components: { | components: { | ||||
RemoveAutoComplete, | RemoveAutoComplete, | ||||
Fingerprint, | |||||
Fingerprint | |||||
}, | }, | ||||
watch: { | watch: { | ||||
'password.site': function (siteId) { | 'password.site': function (siteId) { | ||||
@@ -211,9 +211,7 @@ | |||||
} | } | ||||
}, | }, | ||||
created: function () { | created: function () { | ||||
if (this.isAuthenticated) { | |||||
this.$store.dispatch('loadPasswords'); | |||||
} | |||||
this.$store.dispatch('loadPasswords'); | |||||
var cb = new Clipboard('#copyPasswordButton'); | var cb = new Clipboard('#copyPasswordButton'); | ||||
cb.on('success', function (e) { | cb.on('success', function (e) { | ||||
@@ -50,15 +50,11 @@ | |||||
}) | }) | ||||
} | } | ||||
}), | }), | ||||
methods: Object.assign(mapActions(['go']), { | methods: Object.assign(mapActions(['go']), { | ||||
setCurrentPasswordAndGoIndex(password){ | setCurrentPasswordAndGoIndex(password){ | ||||
this.$store.dispatch('setCurrentPassword', password); | this.$store.dispatch('setCurrentPassword', password); | ||||
this.go('index'); | this.go('index'); | ||||
} | } | ||||
}), | |||||
created: function () { | |||||
this.$store.dispatch('loadPasswords'); | |||||
} | |||||
}) | |||||
} | } | ||||
</script> | </script> |
@@ -59,9 +59,11 @@ const actions = { | |||||
commit('logout'); | commit('logout'); | ||||
}, | }, | ||||
loadPasswords: ({commit}) => { | loadPasswords: ({commit}) => { | ||||
passwords.all().then(response => { | |||||
commit('loadPasswords', response.data.results); | |||||
}); | |||||
if (auth.isAuthenticated()) { | |||||
passwords.all().then(response => { | |||||
commit('loadPasswords', response.data.results); | |||||
}); | |||||
} | |||||
}, | }, | ||||
setCurrentPassword: ({commit}, password) => commit('setCurrentPassword', password), | setCurrentPassword: ({commit}, password) => commit('setCurrentPassword', password), | ||||
}; | }; | ||||
@@ -85,3 +87,10 @@ export default function (config) { | |||||
}); | }); | ||||
} | } | ||||
const fiveMinutes = 1000 * 60 * 5; | |||||
if (auth.isAuthenticated()) { | |||||
auth.refreshToken(); | |||||
setInterval(()=> { | |||||
auth.refreshToken(); | |||||
}, fiveMinutes); | |||||
} |