Surprised it isn’t built-in. I’ve used JWTDecode.swift to decode tokens:

guard let jwt = try? decode(jwt: token),
      let expires = jwt.expiresAt else {
    print("Can't decode jwt")
    return
}