hasValidToken method

Future<bool> hasValidToken()

Returns true if a non-expired token exists in storage.

Unlike getValidToken, this method never triggers a refresh — it purely inspects the current stored state. Use it for "are we logged in?" checks in UI code where side effects are unwanted.

Does not respect proactiveWindow: a token that is within the proactive window but not yet expired returns true.

Implementation

Future<bool> hasValidToken() async {
  final token = await _storage.read();
  if (token == null) return false;
  return token.isValid(_clock.now());
}