Refresh Tokens¶
refresh_tokens
¶
Refresh token adapter interface.
Defines the abstract interface for refresh token storage and retrieval. Inherits from BaseTokenAdapter for common token operations.
Classes¶
RefreshTokenAdapter
¶
Bases: BaseTokenAdapter[Any]
Abstract base class for refresh token database operations.
Inherits from BaseTokenAdapter and provides backward compatibility with the get_active() and revoke() methods.
Functions¶
get_active
¶
Get an active (not revoked) refresh token.
This is a convenience method that calls get_valid().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token_hash |
str
|
Hashed token to look up |
required |
Returns:
| Type | Description |
|---|---|
Any
|
Token record if found and active, None otherwise |
Source code in fastauth/adapters/base/refresh_tokens.py
revoke
¶
Revoke a refresh token.
This is a convenience method that calls invalidate().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token_hash |
str
|
Hashed token to revoke |
required |