November 2017
Beginner to intermediate
398 pages
8h 42m
English
The logout method consists of a simple call to the /logout path on the server, which should return an object with the status property equal to 'ok':
<script>export default { methods: { async logout () { const result = await this.$fetch('logout') if (result.status === 'ok') { this.$state.user = null } }, },}</script>
If the user successfully logged out, we reset the user value in the global state.
Read now
Unlock full access