2020-02-12 21:18:40 +01:00
|
|
|
<template>
|
|
|
|
<footer class="has-background-black-ter">
|
|
|
|
<div class="columns is-gapless" v-if="showButtons">
|
|
|
|
<div class="column has-text-centered">
|
|
|
|
<div class="field is-grouped">
|
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="content has-text-centered">
|
2020-02-13 17:19:55 +01:00
|
|
|
<router-link :to="{ name: 'profile' }" class="has-text-grey">{{ $t('commons.profile') }}</router-link> - <a class="has-text-grey" @click="logout">{{ $t('auth.sign_out') }}</a>
|
2020-02-12 21:18:40 +01:00
|
|
|
</div>
|
|
|
|
</footer>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: 'VueFooter',
|
|
|
|
|
|
|
|
data(){
|
|
|
|
return {
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
showButtons: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
async logout(evt) {
|
|
|
|
if(confirm(this.$t('auth.confirm.logout'))) {
|
|
|
|
|
|
|
|
await this.axios.get('api/logout')
|
|
|
|
|
2020-02-28 14:55:14 +01:00
|
|
|
localStorage.removeItem('jwt')
|
|
|
|
localStorage.removeItem('user')
|
2020-02-12 21:18:40 +01:00
|
|
|
|
2020-02-28 14:55:14 +01:00
|
|
|
delete this.axios.defaults.headers.common['Authorization']
|
2020-02-12 21:18:40 +01:00
|
|
|
|
2020-02-28 14:55:14 +01:00
|
|
|
this.$router.push({ name: 'login' })
|
2020-02-12 21:18:40 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|