<script setup lang="ts">
import { getAuthClient } from '@/api/auth_client';
import { useAuthStore } from '@/stores/auth';
import { ref } from 'vue';
import HeaderMenu from '@/components/HeaderMenu.vue'

const authStore = useAuthStore();
const client = getAuthClient();

const permissions = ref<string[]>([])

async function getPermissions() {
    permissions.value = []
    const res = await client.GetPermissions({})
    permissions.value = res.permissions!
}

getPermissions()
</script>

<template>
    <HeaderMenu :add-logout="true" active="office" />

    <p>
        Доброго времени суток, {{ authStore.username }}.
    </p>
    <!-- <p>
        {{ authStore.userRoles }}
    </p>

    {{ permissions }} -->
</template>

<style scoped></style>
