refreshSessionIfNeeded method

  1. @override
Future<void> refreshSessionIfNeeded()
override

Called the session manager to conditionally refresh the active session.

Implementation

@override
Future<void> refreshSessionIfNeeded() async {
  final session = _session;
  if (session != null) {
    if (shouldRefresh(session)) {
      final response = await _auth.refreshSession(session.refreshJwt);
      session.updateTokens(response);
    }
  }
}