Skip to content

Instantly share code, notes, and snippets.

@salihgueler
Created May 12, 2023 10:25
Show Gist options
  • Save salihgueler/8d8b7a725f18d02a4baa1d9a6634efc6 to your computer and use it in GitHub Desktop.
Save salihgueler/8d8b7a725f18d02a4baa1d9a6634efc6 to your computer and use it in GitHub Desktop.
final session = await Amplify.Auth.fetchAuthSession() as CognitoAuthSession;
final userTokenResult = session.userPoolTokensResult.type;
switch (userTokenResult) {
case AuthSuccessResult(value: final tokens):
safePrint('Successfully fetched the tokens: $tokens');
case AuthErrorResult(:final exception):
safePrint('Failed to fetch the tokens: $exception');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment