<template>
  <div>
    <p v-if="user.authenticated">Logged in. <a @click="logout()">Logout</a></p>
    <p v-else-if="!user.authenticated">not logged in. <router-link to="/login">Login</router-link></p>
  </div>
</template>

<script>
import auth from '../auth'

export default {
  name: 'Home',
  data () {
    return {
      user: auth.user
    }
  },
  methods: {
    logout () {
      auth.logout()
    }
  }
}
</script>
