From 8265cb7f06e9cc909e70e8e30f85314dec2f10f5 Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Mon, 20 Feb 2017 13:10:55 -0700 Subject: [PATCH] add logout handling --- src/App.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/App.vue b/src/App.vue index f4ea6b9..0d1ce00 100644 --- a/src/App.vue +++ b/src/App.vue @@ -22,6 +22,9 @@ About + + Logout + @@ -46,6 +49,12 @@ components: { TopNav, }, + methods: { + logout() { + store.dispatch('userLogout') + .then(() => this.$router.push({ name: 'login' })); + } + }, // pre-route auth checking beforeRouteEnter(to, from, next) { // if user is authenticated, continue