forceRefresh method

Future<Result<Token>> forceRefresh()

Forces a refresh, regardless of expiry.

If a refresh is already in flight, the existing one is reused — this preserves the single-flight guarantee.

Implementation

Future<Result<Token>> forceRefresh() async {
  _checkNotDisposed();
  final current = await _storage.read();
  if (current == null) {
    return const Error<Token>(
      Failure.unauthorized(message: 'No token to refresh'),
    );
  }
  return _runRefresh(current);
}