diff --git a/app.vue b/app.vue
index 2ccd360..e3500ab 100644
--- a/app.vue
+++ b/app.vue
@@ -1,6 +1,9 @@
diff --git a/components/layout/full/vertical-header/ProfileDD.vue b/components/layout/full/vertical-header/ProfileDD.vue
index cf18f75..d34c62e 100644
--- a/components/layout/full/vertical-header/ProfileDD.vue
+++ b/components/layout/full/vertical-header/ProfileDD.vue
@@ -3,16 +3,13 @@
import { MailIcon } from "vue-tabler-icons";
import { PerfectScrollbar } from "vue3-perfect-scrollbar";
import { useAuth } from "~/composables/useAuth";
-import { computed, onMounted } from "vue";
+import { computed, onMounted, watch } from "vue";
const auth = useAuth();
-// Load user data on mount
-onMounted(async () => {
- if (!auth.user.value) {
- await auth.checkAuth();
- }
-});
+
+// Auth state is automatically populated by plugins/auth.client.ts
+// No need to call checkAuth() here
// Logout with confirmation
const logoutWithConfirmation = async () => {
@@ -28,20 +25,21 @@ const logoutWithConfirmation = async () => {
};
// Get user display info from auth
-const displayInfo = computed(() => {
+const displayInfo = computed(() => {
if (!auth.user.value) {
return {
name: "Guest User",
email: "guest@example.com",
- role: "Guest"
+ role: ["Guest"]
};
}
const user = auth.user.value;
+
return {
name: user.name || user.preferred_username || "User",
email: user.email || "No email",
- role: user.client_roles
+ role: user.client_roles || []
};
});
diff --git a/components/layout/full/vertical-sidebar/VerticalSidebar.vue b/components/layout/full/vertical-sidebar/VerticalSidebar.vue
index 35f6fbd..7b69df8 100644
--- a/components/layout/full/vertical-sidebar/VerticalSidebar.vue
+++ b/components/layout/full/vertical-sidebar/VerticalSidebar.vue
@@ -7,8 +7,11 @@ import { Icon } from "@iconify/vue";
import { useRoute } from "vue-router";
// MiniSidebar Icons
import MiniSideIcons from "./MinIconItems";
+import { useUserMenu } from "~/composables/useUserMenu";
+
const route = useRoute();
+const { menuItems, hasMenu, isLoading, error, initializeMenu } = useUserMenu();
const findTitleByPath = (items: any, path: any) => {
@@ -37,7 +40,17 @@ const findTitleByPath = (items: any, path: any) => {
return title;
};
-const foundId = findTitleByPath(sidebarItems, route.path);
+
+const sidebarMenu = computed(() => {
+ if (hasMenu.value) {
+ return menuItems.value;
+ } else {
+ return [];
+ }
+});
+
+
+const foundId = findTitleByPath(sidebarMenu.value, route.path);
const getCurrent = foundId ? foundId : 1;
const currentMenu = ref(getCurrent);
function showData(data: any) {
@@ -47,7 +60,6 @@ function showData(data: any) {
// MiniSidebar Icons End
const customizer = useCustomizerStore();
-const sidebarMenu = shallowRef(sidebarItems);
// Toggle mini sidebar
const toggleMiniSidebar = () => {
@@ -80,7 +92,15 @@ const toggleMiniSidebar = () => {
-