getCognitoUserSession method

CognitoUserSession getCognitoUserSession(
  1. Map<String, dynamic> authResult
)

This is used to build a user session from tokens retrieved in the authentication result

Implementation

CognitoUserSession getCognitoUserSession(Map<String, dynamic> authResult) {
  final idToken = CognitoIdToken(authResult['IdToken']);
  final accessToken = CognitoAccessToken(authResult['AccessToken']);
  final refreshToken = CognitoRefreshToken(authResult['RefreshToken']);

  return CognitoUserSession(idToken, accessToken, refreshToken: refreshToken);
}