extractClaimValue<R> function

R extractClaimValue<R>(
  1. Claim claim,
  2. String claimName
)

Implementation

R extractClaimValue<R>(Claim claim, String claimName) {
  final extendedClaim = decodeBase64URL(claim.value, claim.indexMod4);
  final (name, value) = verifyExtendedClaim(extendedClaim);
  if (name != claimName) {
    throw ArgumentError("Invalid field name: found $name expected $claimName");
  }
  return value;
}