Skip to content

Commit 38f11ba

Browse files
committed
fix(example): clear username field after logout
1 parent d21515c commit 38f11ba

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

example/src/components/UserManager.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div :class="$style.container">
33
<div v-if="authenticated">
44
Hi, {{ user.name }} ({{ user.type }})
5-
<button @click.prevent="logout">Log out</button>
5+
<button @click.prevent="logMeOut">Log out</button>
66
</div>
77
<div v-else-if="authenticating">
88
Wait...
@@ -55,6 +55,11 @@ export default {
5555
},
5656
methods: {
5757
...mapActions('user', ['logout']),
58+
logMeOut() {
59+
return this.logout().then(() => {
60+
this.username = null
61+
})
62+
},
5863
authenticate() {
5964
if (this.username.trim()) {
6065
this.$store

0 commit comments

Comments
 (0)