getAccessToken method

Future<AccessToken?> getAccessToken({
  1. String? resource,
  2. String? organizationId,
})

Implementation

Future<AccessToken?> getAccessToken(
    {String? resource, String? organizationId}) async {
  final accessToken = await _tokenStorage.getAccessToken(
      resource: resource, organizationId: organizationId);

  if (accessToken != null) {
    return accessToken;
  }

  final token = await _getAccessTokenByRefreshToken(
      resource: resource, organizationId: organizationId);

  return token;
}