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

25 lines
555 B
JavaScript
Raw Normal View History

2016-10-27 18:02:41 +02:00
const LoginForm = {
data: () => ({
user: {},
authError: false
2016-10-27 18:02:41 +02:00
}),
computed: {
loggingIn () { return this.$store.state.users.loggingIn },
registrationOpen () { return this.$store.state.config.registrationOpen }
2016-10-27 18:02:41 +02:00
},
methods: {
submit () {
this.$store.dispatch('loginUser', this.user).then(
2017-10-24 19:24:14 +02:00
() => { this.$router.push('/main/friends') },
(error) => {
this.authError = error
this.user.username = ''
this.user.password = ''
}
)
2016-10-27 18:02:41 +02:00
}
}
}
export default LoginForm