This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/src/components/Home.vue

35 lines
759 B
Vue
Raw Normal View History

2018-09-06 17:46:38 +00:00
<template>
2018-09-09 14:22:02 +00:00
<div class="content has-text-centered">
<h2>Hi {{user.infos.username}}!</h2>
<p>Click on a list or namespace on the left to get started.</p>
2018-09-06 17:46:38 +00:00
</div>
</template>
<script>
import auth from '../auth'
import router from '../router'
export default {
name: "Home",
2018-09-09 14:22:02 +00:00
data() {
2018-09-06 17:46:38 +00:00
return {
2018-09-09 14:22:02 +00:00
user: auth.user
2018-09-06 17:46:38 +00:00
}
2018-09-09 14:22:02 +00:00
},
2018-09-06 17:46:38 +00:00
beforeMount() {
// Check if the user is already logged in, if so, redirect him to the homepage
if (!auth.user.authenticated) {
router.push({name: 'login'})
}
},
2018-09-06 18:01:03 +00:00
methods: {
2018-09-09 14:22:02 +00:00
logout() {
2018-09-06 18:01:03 +00:00
auth.logout()
}
},
2018-09-06 17:46:38 +00:00
}
</script>
<style scoped>
</style>