diff options
Diffstat (limited to 'src/views/Login')
-rw-r--r-- | src/views/Login/Login.vue | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/views/Login/Login.vue b/src/views/Login/Login.vue index 369c56dd..e33cde78 100644 --- a/src/views/Login/Login.vue +++ b/src/views/Login/Login.vue @@ -118,12 +118,22 @@ export default { const password = this.userInfo.password; this.$store .dispatch('authentication/login', [username, password]) - .then(() => this.$router.push('/')) .then(() => { localStorage.setItem('storedLanguage', i18n.locale); localStorage.setItem('storedUsername', username); this.$store.commit('global/setUsername', username); this.$store.commit('global/setLanguagePreference', i18n.locale); + return this.$store.dispatch( + 'authentication/checkPasswordChangeRequired', + username + ); + }) + .then(passwordChangeRequired => { + if (passwordChangeRequired) { + this.$router.push('/change-password'); + } else { + this.$router.push('/'); + } }) .catch(error => console.log(error)) .finally(() => (this.disableSubmitButton = false)); |