2023-04-16 20:12:24 +03:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<h1>Currently logged in</h1>
|
|
|
|
<Button :click="click">Logout</Button>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import axios from 'axios';
|
|
|
|
import Button from './Button.vue';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
methods: {
|
|
|
|
async click(e) {
|
2023-06-11 20:19:35 +03:00
|
|
|
await axios.get(`/api/auth/logout?token=${localStorage.getItem("token")}`)
|
2023-04-16 20:12:24 +03:00
|
|
|
localStorage.clear()
|
|
|
|
location.reload()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
h1{
|
|
|
|
color: var(--white);
|
|
|
|
font-size: 50px;
|
|
|
|
margin-bottom: 20px;
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
div{
|
|
|
|
background-color: var(--dark-three);
|
|
|
|
padding: 50px;
|
|
|
|
margin-top: 50px;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
gap: 20px;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
2023-06-11 20:19:35 +03:00
|
|
|
</style>
|