2016-10-27 09:02:41 -07:00
|
|
|
const LoginForm = {
|
|
|
|
data: () => ({
|
2017-03-08 09:28:41 -08:00
|
|
|
user: {},
|
|
|
|
authError: false
|
2016-10-27 09:02:41 -07:00
|
|
|
}),
|
|
|
|
computed: {
|
|
|
|
loggingIn () { return this.$store.state.users.loggingIn }
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
submit () {
|
2017-03-08 09:28:41 -08:00
|
|
|
this.$store.dispatch('loginUser', this.user).then(
|
|
|
|
() => { this.$router.push('/main/friends')},
|
|
|
|
() => { this.authError = true }
|
|
|
|
)
|
2016-10-27 09:02:41 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default LoginForm
|