authentication
This commit is contained in:
21
src/layout/AppProfileMenu.vue
Normal file
21
src/layout/AppProfileMenu.vue
Normal 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>
|
||||
Reference in New Issue
Block a user