jwtIssuedAtUtc function

DateTime? jwtIssuedAtUtc(
  1. Object? value
)

Parses a JWT iat claim value into a UTC timestamp.

Implementation

DateTime? jwtIssuedAtUtc(Object? value) {
  if (value is! num) {
    return null;
  }
  try {
    return DateTime.fromMillisecondsSinceEpoch(
      value.toInt() * 1000,
      isUtc: true,
    ).toUtc();
  } on ArgumentError {
    return null;
  }
}