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