79299537

Date: 2024-12-21 14:13:45
Score: 1.5
Natty:
Report link

For Amplify Gen 2:

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

const session = await fetchAuthSession();
console.log("id token", session);

There will be an identityId property from the session object returned.

https://docs.amplify.aws/react/build-a-backend/auth/connect-your-frontend/manage-user-sessions/

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: ptt