diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index 280fc9c..ad88370 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -576,7 +576,7 @@ export default { }, logout() { localStorage.removeItem("token"); - this.$store.commit("setToken", ""); + this.$store.commit("issueLogout"); Object.assign(axios.defaults, { headers: { Authorization: this.$store.state.user.token }, }); diff --git a/src/locales/en.json b/src/locales/en.json index 5f6e7a2..be17e1f 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -249,7 +249,14 @@ "devMode": "Developer Mode" }, "security": { - "title": "Security" + "title": "Security", + "password": { + "title": "Changing your password", + "oldPassword": "Please enter your old password", + "newPassword": "Please enter your new desired password", + "newPasswordConfirm": "Please re-enter your desired password", + "change": "Change password (You will be logged out)" + } }, "privacy": { "title": "Privacy" diff --git a/src/store/index.js b/src/store/index.js index f86defc..cf3915e 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -183,6 +183,12 @@ export default new Vuex.Store({ setSecure(state, value) { state.client.secure = value; }, + issueLogout(state) { + state.user.username = '' + state.user.token = '' + state.user.koins = 0 + state.user.id = 0 + }, }, actions: {}, modules: {} diff --git a/src/views/SettingsSecurity.vue b/src/views/SettingsSecurity.vue index 48e6a0e..4bc2665 100644 --- a/src/views/SettingsSecurity.vue +++ b/src/views/SettingsSecurity.vue @@ -1,15 +1,76 @@ \ No newline at end of file