diff --git a/src/components/UserAuthentication.vue b/src/components/UserAuthentication.vue index b133aa849f6ae0f5227dadd5c9706fc15d252284..3ced8f19bbf6e4af88e0ecd5a3623bb708da8846 100644 --- a/src/components/UserAuthentication.vue +++ b/src/components/UserAuthentication.vue @@ -53,7 +53,8 @@ </div> </div> <div v-else class="text-lg ml-1 mb-1"> - Welcome, {{ stateUser.username }} + <span>Welcome, {{ stateUser.username }}</span> + <button @click="logOut" class="ml-2 font-bold">Log out</button> </div> </div> </template> @@ -101,6 +102,14 @@ export default { (error) => console.error("Something went terribly wrong... ", error); } }, + logOut() { + this.saveStateUser({ + id: null, + privileged: null, + username: null, + secret: null, + }); + }, ...mapActions(["saveStateUser"]), }, };