We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ed3b60 commit 23704aeCopy full SHA for 23704ae
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:
178
```ts
179
import { fetchAuthSession } from 'aws-amplify/auth';
180
181
-const { tokens } = await fetchAuthSession();
182
-const groups = tokens.accessToken.payload['cognito:groups'] || [];
+const session = await fetchAuthSession();
+const groups = session.tokens.accessToken.payload['cognito:groups'] || [];
183
+
184
console.log('User groups:', groups);
185
```
186
</InlineFilter>
0 commit comments