Session class

A session authenticated for a user with Satori server.

Annotations
  • @freezed

Constructors

Session.new({required String token, required String refreshToken, required String identityId, required DateTime expiresAt, required DateTime refreshExpiresAt})
factory
Session.fromApi(ApiSession session)
factory

Properties

copyWith → $SessionCopyWith<Session>
no setterinherited
expiresAt DateTime
The time when the session token expires.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
identityId String
The ID of the user who owns this session.
no setterinherited
isExpired bool
If the session has expired.
no setter
isRefreshExpired bool
If the refresh token has expired.
no setter
refreshExpiresAt DateTime
The time when the refresh token expires.
no setterinherited
refreshToken String
Refresh token that can be used for session token renewal.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
token String
The authorization token used to construct this session.
no setterinherited

Methods

hasExpired(DateTime time) bool
Check the session has expired against the time.
hasRefreshExpired(DateTime time) bool
Check if the refresh token has expired against the time.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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