isTokenValid static method

bool isTokenValid(
  1. AuthConfig? auth
)

Validate token by checking expiration

Implementation

static bool isTokenValid(AuthConfig? auth) {
  if (auth == null) return false;
  if (auth.type == AuthType.apiKey) {
    return auth.apiKey != null;
  }
  if (auth.type == AuthType.jwt) {
    if (auth.token == null) return false;
    if (auth.isExpired) return false;
    return true;
  }
  return false;
}