getSession method

Future<OAuthSession> getSession()

Implementation

Future<OAuthSession> getSession() async {
  var current = _session ?? await _load();
  final exp = current.expiresAt;
  if (exp != null &&
      exp.isBefore(DateTime.now().toUtc().add(_refreshSkew)) &&
      _client != null) {
    current = await _refresh(current);
  }
  return current;
}