Skip to content

Instantly share code, notes, and snippets.

@salihgueler
Created May 11, 2023 13:23
Show Gist options
  • Save salihgueler/0a4e6d07f304cb5b50486111dcb21485 to your computer and use it in GitHub Desktop.
Save salihgueler/0a4e6d07f304cb5b50486111dcb21485 to your computer and use it in GitHub Desktop.
final session = await Amplify.Auth.fetchAuthSession() as CognitoAuthSession;
final userTokenResult = session.userPoolTokensResult.type;
final result = switch (userTokenResult) {
AWSResultType.success => 'Successfully fetched the identityId',
AWSResultType.error => 'Failed to fetch the identityId'
};
safePrint(result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment