Session class abstract

Represents a user session.

A session includes data about the authenticated user, including their DID, handle, email, and the access and refresh JSON Web Tokens (JWT).

Available extensions
Annotations
  • @freezed

Constructors

Session({required String did, required String handle, String? email, @Default.new(false) bool emailConfirmed, @Default.new(false) bool emailAuthFactor, required String accessJwt, required String refreshJwt, Map<String, dynamic>? didDoc, @Default.new(true) bool active, String? status})
const
factory
Session.fromJson(Map<String, Object?> json)
factory

Properties

accessJwt → String
Access JSON Web Token.
no setterinherited
accessTokenJwt → Jwt

Available on Session, provided by the SessionExtension extension

Returns decoded accessJwt.
no setter
active → bool
no setterinherited
atprotoPdsEndpoint → String?

Available on Session, provided by the SessionExtension extension

Returns PDS endpoint like porcini.us-east.host.bsky.network dynamically based on this Session.
no setter
copyWith → $SessionCopyWith<Session>
Create a copy of Session with the given fields replaced by the non-null parameter values.
no setterinherited
did → String
Decentralized Identifier for the user.
no setterinherited
didDoc → Map<String, dynamic>?
DID plc document.
no setterinherited
email → String?
User's email address.
no setterinherited
emailAuthFactor → bool
no setterinherited
emailConfirmed → bool
A flag indicating whether the email address is confirmed.
no setterinherited
handle → String
User handle.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
isEmailConfirmed → bool

Available on Session, provided by the SessionExtension extension

no setter
refreshJwt → String
Refresh JSON Web Token.
no setterinherited
refreshTokenJwt → Jwt

Available on Session, provided by the SessionExtension extension

Returns decoded refreshJwt.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
status → String?
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes this Session to a JSON map.
inherited
toString() → String
Redacts accessJwt and refreshJwt so credentials are not leaked through logs, print, or crash reporters that stringify a Session.
override

Operators

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