akkoma-fe/src/components/login_form/login_form.js
2018-09-17 17:51:39 +03:00

25 lines
521 B
JavaScript

const LoginForm = {
data: () => ({
user: {},
authError: false
}),
computed: {
loggingIn () { return this.$store.state.users.loggingIn },
registrationOpen () { return this.$store.state.instance.registrationOpen }
},
methods: {
submit () {
this.$store.dispatch('loginUser', this.user).then(
() => {},
(error) => {
this.authError = error
this.user.username = ''
this.user.password = ''
}
)
}
}
}
export default LoginForm