Add token revocation mechanism and support for logout APIs
This commit introduces a system to revoke tokens by storing their `jti` in a new `RevokedToken` model. It includes APIs for logging out (revoking a current token) and logging out from all devices (revoking all tokens). Additionally, token validation now checks revocation status during the decode process.
This commit is contained in:
@@ -29,7 +29,7 @@ from .gift import (
|
||||
from .email_template import EmailTemplate, TemplateType
|
||||
from .notification_log import NotificationLog, NotificationType, NotificationStatus
|
||||
from .activity_log import ActivityLog, ActivityType
|
||||
|
||||
from .token import RevokedToken
|
||||
# Make sure all models are imported above this line
|
||||
__all__ = [
|
||||
'Base', 'TimestampMixin', 'UUIDMixin',
|
||||
@@ -40,4 +40,5 @@ __all__ = [
|
||||
'EmailTemplate', 'TemplateType',
|
||||
'NotificationLog', 'NotificationType', 'NotificationStatus',
|
||||
'ActivityLog', 'ActivityType',
|
||||
'RevokedToken',
|
||||
]
|
||||
Reference in New Issue
Block a user