From 23704aed8a9d5f6b15ca8b99f905245b91530975 Mon Sep 17 00:00:00 2001 From: Chris Bonifacio Date: Thu, 19 Dec 2024 10:55:01 -0500 Subject: [PATCH] simplify example and add some spacing --- .../customize-authz/user-group-based-data-access/index.mdx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/[platform]/build-a-backend/data/customize-authz/user-group-based-data-access/index.mdx b/src/pages/[platform]/build-a-backend/data/customize-authz/user-group-based-data-access/index.mdx index bb3a5ea8b2c..3c32f50abbc 100644 --- a/src/pages/[platform]/build-a-backend/data/customize-authz/user-group-based-data-access/index.mdx +++ b/src/pages/[platform]/build-a-backend/data/customize-authz/user-group-based-data-access/index.mdx @@ -178,8 +178,9 @@ You can access a user's groups from their session using the Auth category: ```ts import { fetchAuthSession } from 'aws-amplify/auth'; -const { tokens } = await fetchAuthSession(); -const groups = tokens.accessToken.payload['cognito:groups'] || []; +const session = await fetchAuthSession(); +const groups = session.tokens.accessToken.payload['cognito:groups'] || []; + console.log('User groups:', groups); ```