authentication

This commit is contained in:
paola.trabucco
2024-08-07 14:53:43 +02:00
parent ae95f2b4cc
commit e20f7521bb
7 changed files with 134 additions and 24 deletions

View File

@@ -0,0 +1,21 @@
<template>
<div class="config-panel hidden">
<div class="config-panel-content">
<span class="config-panel-label">Welcome </span>
<span v-if="user">
{{ user.name + " " + user.surname }}
</span>
<button @click="auth.logout()" class="p-button p-button-danger p-button-outlined">Logout</button>
</div>
</div>
</template>
<script setup>
import { useAuth } from '@websanova/vue-auth/src/v3.js';
import { computed } from 'vue';
const auth = useAuth();
const user = computed(() => auth.user());
</script>