diff --git a/client/src/components/profile/ProfileSidebar.vue b/client/src/components/profile/ProfileSidebar.vue index db7dfc1e..0a562ba8 100644 --- a/client/src/components/profile/ProfileSidebar.vue +++ b/client/src/components/profile/ProfileSidebar.vue @@ -7,11 +7,15 @@
- - Klasse + + @@ -21,6 +25,7 @@ import SIDEBAR from '@/graphql/gql/local/sidebar.gql'; import TOGGLE_SIDEBAR from '@/graphql/gql/local/mutations/toggleSidebar.gql'; + import LOGOUT_MUTATION from '@/graphql/gql/mutations/logoutUser.gql'; export default { components: { @@ -36,6 +41,15 @@ open: false } }); + }, + logout() { + this.$apollo.mutate({ + mutation: LOGOUT_MUTATION, + }).then(({data}) => { + if (data.logout.success) { + location.replace('/logout') + } + }); } },