diff --git a/app/assets/vue/views/Login.vue b/app/assets/vue/views/Login.vue index a725a54..81cba85 100644 --- a/app/assets/vue/views/Login.vue +++ b/app/assets/vue/views/Login.vue @@ -67,19 +67,20 @@ }, }, methods: { - performLogin () { - let payload = { login: this.$data.login, password: this.$data.password }, + performLogin() { + let payload = {login: this.$data.login, password: this.$data.password}, redirect = this.$route.query.redirect; - this.$store.dispatch('security/login', payload) .then(() => { - if (typeof redirect !== 'undefined') { - this.$router.push({path: redirect}); - } else { - this.$router.push({path: '/home'}); + if (!this.$store.getters['security/hasError']) { + if (typeof redirect !== 'undefined') { + this.$router.push({path: redirect}); + } else { + this.$router.push({path: '/home'}); + } } }); }, }, } - \ No newline at end of file +