aboutsummaryrefslogtreecommitdiff
path: root/src/components/login_form/login_form.js
blob: 1a6f6015432eb6c5f372f4e9504b978d7aa83273 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const LoginForm = {
  data: () => ({
    user: {},
    authError: false
  }),
  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 = ''
        }
      )
    }
  }
}

export default LoginForm