aboutsummaryrefslogtreecommitdiff
path: root/src/components/login_form/login_form.js
diff options
context:
space:
mode:
authorShpuld Shpuldson <shpuld@gmail.com>2017-03-08 19:21:36 -0500
committerShpuld Shpuldson <shpuld@gmail.com>2017-03-08 19:21:36 -0500
commitba4f7ef3efe15aaebce523113283b5854d16ceb8 (patch)
tree9966b6b858e713c797b08fccea5d77d9b9e310ee /src/components/login_form/login_form.js
parentaeda390da0ef99a8fda9f059cf4d8168aa1938c2 (diff)
parent9511691c9467e26c3237b4a2c936e8a757b3e515 (diff)
Merge branch 'feature/failed-login-error' into 'develop'
Visual feedback on failed login See merge request !49
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..bc801397 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(
+ () => { this.$router.push('/main/friends')},
+ (error) => {
+ this.authError = error
+ this.user.username = ''
+ this.user.password = ''
+ }
+ )
}
}
}