AuthToken constructor

  1. @jsonSerializable
const AuthToken({
  1. required AuthScope scope,
  2. @JsonKey(name: 'sub') required String subject,
  3. @dateTimeConverter @JsonKey(name: 'exp') required DateTime expiresAt,
  4. @dateTimeConverter @JsonKey(name: 'iat') required DateTime issuedAt,
})

Creates a new instance of AuthToken.

Implementation

@jsonSerializable
const factory AuthToken({
  /// A scope of this token.
  required AuthScope scope,

  /// Authenticated subject.
  @JsonKey(name: 'sub') required String subject,

  /// Date and time this token will expire.
  @dateTimeConverter @JsonKey(name: 'exp') required DateTime expiresAt,

  /// Date and time this token was issued.
  @dateTimeConverter @JsonKey(name: 'iat') required DateTime issuedAt,
}) = _AuthToken;