diff --git a/components/Navbar.vue b/components/Navbar.vue
index 3a70880..7012a1f 100644
--- a/components/Navbar.vue
+++ b/components/Navbar.vue
@@ -22,7 +22,7 @@
My Profile
- Logout
+ Logout
@@ -45,6 +45,15 @@ import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters(['isAuthenticated', 'loggedInUser'])
+ },
+
+ methods: {
+ async logout () {
+ // We call the logout() of the Auth module.
+ // This will simply delete the user’s token from localstorage
+ // and redirect the user to the homepage.
+ await this.$auth.logout()
+ }
}
}