DatabaseTokenService class
Database implementation of TokenService
This service provides concrete token management operations using the existing DatabaseAuthRepository.
- Implemented types
Constructors
- DatabaseTokenService({DatabaseAuthRepository? repository})
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)
override
-
cleanupExpiredTokens(
) → Future< int> -
Cleans up expired tokens
override
-
deleteToken(
String token) → Future< int> -
Deletes a specific token
override
-
deleteUserTokens(
dynamic userId, {String? guard, Map< String, dynamic> ? filter}) → Future<int> -
Deletes all tokens for a user
override
-
findToken(
String token) → Future< Map< String, dynamic> ?> -
Finds a token by token string
override
-
findTokensBySession(
String sessionId, [String? guard, String? type]) → Future< List< Map< >String, dynamic> > -
Finds tokens by session ID
override
-
findTokensByUser(
dynamic userId, [String? guard]) → Future< List< Map< >String, dynamic> > -
Finds all tokens for a specific user
override
-
invalidateSession(
String sessionId, [String? guard]) → Future< int> -
Invalidates a specific session
override
-
isTokenBlacklisted(
String token) → Future< bool> -
Checks if a token is blacklisted
override
-
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
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited