feat: logout button for gamemasters/admins
This commit is contained in:
parent
4fe057f5d9
commit
908080cde6
@ -7,6 +7,7 @@
|
||||
<button @click="finishGame">Finish Game</button>
|
||||
<button v-if="$route.path != '/play'" @click="go('/play')">switch to game</button>
|
||||
<button v-if="$route.path != '/admin'" @click="go('/admin')">admin interface</button>
|
||||
<button class="button-logout" @click="logout">logout</button>
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
@ -40,6 +41,11 @@ export default {
|
||||
go(path) {
|
||||
this.$router.push({ path })
|
||||
},
|
||||
async logout() {
|
||||
this.authCode = ''
|
||||
await this.$axios.$get('/api/logout')
|
||||
this.go('/')
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@ -56,5 +62,9 @@ export default {
|
||||
padding: 0 1rem;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.button-logout {
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user