TokenService class abstract

Token management service interface

This interface abstracts token storage, retrieval, and management operations. It provides a clean separation between token business logic and data persistence.

Implementers

Constructors

TokenService()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

blacklistToken(Map<String, dynamic> tokenData) Future<Map<String, dynamic>>
Blacklists a token (for stateless tokens like JWT)
cleanupExpiredTokens() Future<int>
Cleans up expired tokens
deleteToken(String token) Future<int>
Deletes a specific token
deleteUserTokens(dynamic userId, {String? guard, Map<String, dynamic>? filter}) Future<int>
Deletes all tokens for a user
findToken(String token) Future<Map<String, dynamic>?>
Finds a token by token string
findTokensBySession(String sessionId, [String? guard, String? type]) Future<List<Map<String, dynamic>>>
Finds tokens by session ID
findTokensByUser(dynamic userId, [String? guard]) Future<List<Map<String, dynamic>>>
Finds all tokens for a specific user
invalidateSession(String sessionId, [String? guard]) Future<int>
Invalidates a specific session
isTokenBlacklisted(String token) Future<bool>
Checks if a token is blacklisted
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
storeToken(Map<String, dynamic> tokenData) Future<Map<String, dynamic>>
Stores a token with associated metadata
toString() String
A string representation of this object.
inherited

Operators

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