#✅ - Custom Claims in v6

3 messages · Page 1 of 1 (latest)

ocean walrus
#

We are using custom claims in our v5 Amplify app. The custom claims are dynamic groups a user is part of. When the user joins a new group we trigger a token refresh in the client, which in turn updates their custom claim. In v6 we have not found a way to trigger a token refresh. Is there a solution to this?

lofty kettle
#

In case anyone else is struggling with this, we found out by now this is the new way to refresh a session.

import { fetchAuthSession } from 'aws-amplify/auth';

await fetchAuthSession({ forceRefresh: true });
next coralBOT
#

✅ - Custom Claims in v6