aboutsummaryrefslogtreecommitdiff
path: root/src/components/login_form/login_form.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/login_form/login_form.js')
-rw-r--r--src/components/login_form/login_form.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/components/login_form/login_form.js b/src/components/login_form/login_form.js
index 827c704c..1a6f6015 100644
--- a/src/components/login_form/login_form.js
+++ b/src/components/login_form/login_form.js
@@ -1,13 +1,21 @@
const LoginForm = {
data: () => ({
- user: {}
+ user: {},
+ authError: false
}),
computed: {
loggingIn () { return this.$store.state.users.loggingIn }
},
methods: {
submit () {
- this.$store.dispatch('loginUser', this.user)
+ this.$store.dispatch('loginUser', this.user).then(
+ () => {},
+ (error) => {
+ this.authError = error
+ this.user.username = ''
+ this.user.password = ''
+ }
+ )
}
}
}