from static method

dynamic from(
  1. String token
)

Implementation

static from(String token) {
  List<String> parts = token.split(".");

  final header = _decodeGroup(parts[0]);
  final payload = _decodeGroup(parts[1]);
  final secret = parts[2];

  final jwt = Jwt(
      header: JwtHeader.fromJson(header),
      payload: JwtPayload.fromJson(payload),
      secret: secret);

  jwt.token = token;

  return jwt;
}