feat: useMenuItems

This commit is contained in:
2026-03-27 08:18:18 -04:00
parent 5013935e84
commit 31ac7b8b4d
6 changed files with 44 additions and 3 deletions

View File

@@ -43,10 +43,10 @@ export async function handleLogout(event: H3Event) {
* @param user The AuthUserFragment containing user data from the GraphQL response
* @returns A User object with the expected structure for nuxt-auth-utils, including an array of role names
*/
function getAuthUser(user: AuthUserFragment) {
function getAuthUser({ roles, ...user }: AuthUserFragment) {
return {
...user,
roles: user.roles.nodes.map(({ name }) => name) || [],
roles: extractNodes(roles).map(({ name }) => name),
};
}