Skip to content

Commit

Permalink
simplify example and add some spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbonifacio committed Dec 19, 2024
1 parent 5ed3b60 commit 23704ae
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
```
</InlineFilter>

0 comments on commit 23704ae

Please sign in to comment.