isExpiringSoon method

bool isExpiringSoon([
  1. Duration threshold = const Duration(minutes: 5)
])

토큰이 곧 만료되는지 확인 (기본 5분 전)

Implementation

bool isExpiringSoon([Duration threshold = const Duration(minutes: 5)]) {
  if (expiresAt == null) return false;
  return DateTime.now().add(threshold).isAfter(expiresAt!);
}