yandere_fe/src/components/login_form/login_form.js

25 lines
522 B
JavaScript
Raw Normal View History

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