AuthToken class

Represents an issued token associated session.

Annotations
  • @freezed

Constructors

AuthToken({required AuthScope scope, @JsonKey(name: 'sub') required String subject, @dateTimeConverter @JsonKey(name: 'exp') required DateTime expiresAt, @dateTimeConverter @JsonKey(name: 'iat') required DateTime issuedAt})
Creates a new instance of AuthToken.
const
factory
AuthToken.fromJson(Map<String, Object?> json)
Creates a new instance of AuthToken from a JSON object.
factory

Properties

copyWith → $AuthTokenCopyWith<AuthToken>
Create a copy of AuthToken with the given fields replaced by the non-null parameter values.
no setterinherited
expiresAt DateTime
Date and time this token will expire.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isExpired bool
Returns true if this token is expired, otherwise false.
no setter
issuedAt DateTime
Date and time this token was issued.
no setterinherited
remainingTime Duration
Returns the time until this token expires.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scope AuthScope
A scope of this token.
no setterinherited
subject String
Authenticated subject.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this AuthToken to a JSON map.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited