From 0c3cd05965c591d136207ac88a598209e371dbb6 Mon Sep 17 00:00:00 2001 From: raeno Date: Fri, 30 Nov 2018 17:30:55 +0400 Subject: [PATCH 1/2] Logout user on password change --- src/components/user_settings/user_settings.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js index a6203962..b1d7663f 100644 --- a/src/components/user_settings/user_settings.js +++ b/src/components/user_settings/user_settings.js @@ -235,6 +235,7 @@ const UserSettings = { if (res.status === 'success') { this.changedPassword = true this.changePasswordError = false + this._logout() } else { this.changedPassword = false this.changePasswordError = res.error @@ -243,6 +244,10 @@ const UserSettings = { }, activateTab (tabName) { this.activeTab = tabName + }, + _logout () { + this.$store.dispatch('logout') + this.$router.replace('/') } } } From 59b84c2a06f3d280419b2bfd6561130dd83803c1 Mon Sep 17 00:00:00 2001 From: raeno Date: Fri, 30 Nov 2018 18:53:59 +0400 Subject: [PATCH 2/2] Do not use underscore at the beginning of the method --- src/components/user_settings/user_settings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js index b1d7663f..761e674a 100644 --- a/src/components/user_settings/user_settings.js +++ b/src/components/user_settings/user_settings.js @@ -235,7 +235,7 @@ const UserSettings = { if (res.status === 'success') { this.changedPassword = true this.changePasswordError = false - this._logout() + this.logout() } else { this.changedPassword = false this.changePasswordError = res.error @@ -245,7 +245,7 @@ const UserSettings = { activateTab (tabName) { this.activeTab = tabName }, - _logout () { + logout () { this.$store.dispatch('logout') this.$router.replace('/') }