Skip to content

Commit

Permalink
add logout icon
Browse files Browse the repository at this point in the history
  • Loading branch information
ammezie committed Feb 12, 2018
1 parent 9e00429 commit 61b04dc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/User/UserSidebar.vue
Expand Up @@ -15,7 +15,9 @@
</router-link>
<router-link class="item" :to="`/${user.username}`">Profile</router-link>
<router-link class="item" to="/settings/profile">Settings</router-link>
<a class="item"><i class="sign out icon"></i></a>
<a class="item" @click="logout">
<i class="sign out icon"></i>
</a>
</div>
</div>
</template>
Expand Down Expand Up @@ -62,6 +64,11 @@
// clear input field
this.tweet = ''
})
},
logout () {
localStorage.removeItem('tweetr-token')
this.$router.push('/login')
}
}
}
Expand Down

0 comments on commit 61b04dc

Please sign in to comment.