akkoma-fe/src/components/login_form/login_form.js

24 lines
441 B
JavaScript
Raw Normal View History

2016-10-27 16:02:41 +00:00
const LoginForm = {
data: () => ({
user: {},
authError: false
2016-10-27 16:02:41 +00:00
}),
computed: {
loggingIn () { return this.$store.state.users.loggingIn }
},
methods: {
submit () {
this.$store.dispatch('loginUser', this.user).then(
() => {},
(error) => {
this.authError = error
this.user.username = ''
this.user.password = ''
}
)
2016-10-27 16:02:41 +00:00
}
}
}
export default LoginForm