<template>
  <div>
  <p v-if="user.authenticated"><a v-link="'login'" @click="logout()">Logout</a></p>
  <p v-else-if="!user.authenticated"><a v-link="'login'">Login</a></p>
  <div class="container">
    <router-view></router-view>
  </div>
  </div>
</template>

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

export default {
  data() {
    return {
      user: auth.user
    }
  },

  methods: {
    logout() {
      auth.logout()
    }
  }
}
</script>
