feat: logout werkt en initialen zijn deze van ingelogde user

This commit is contained in:
Laure Jablonski 2025-03-19 10:47:20 +01:00
parent 06b5a93cef
commit 60916ba765

View file

@ -15,9 +15,8 @@
const role = auth.authState.activeRole; const role = auth.authState.activeRole;
//TODO: use authState form services map to get user token const name : string = auth.authState.user!.profile.name!;
const name = "Kurt Cobain"; const initials : string = name
const initials = name
.split(" ") .split(" ")
.map((n) => n[0]) .map((n) => n[0])
.join(""); .join("");
@ -34,6 +33,11 @@
localStorage.setItem("user-lang", langCode); localStorage.setItem("user-lang", langCode);
console.log(langCode); console.log(langCode);
}; };
// when the user wants to logout, the authentication must be set to False
function performLogout() {
auth.logout();
}
</script> </script>
<template> <template>
@ -107,7 +111,7 @@
</div> </div>
<div class="right"> <div class="right">
<li> <li>
<router-link :to="`/login`"> <v-btn @click="performLogout" to="/login" style="background-color: transparent; box-shadow: none !important;">
<v-tooltip <v-tooltip
:text="t('logout')" :text="t('logout')"
location="bottom" location="bottom"
@ -121,7 +125,7 @@
></v-icon> ></v-icon>
</template> </template>
</v-tooltip> </v-tooltip>
</router-link> </v-btn>
</li> </li>
<li> <li>
<v-avatar <v-avatar