mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 06:57:47 +01:00
Merge remote-tracking branch 'origin/33-frontend-looks-like-logged-in-even-after-token-expires' into 33-frontend-looks-like-logged-in-even-after-token-expires
This commit is contained in:
@@ -3,7 +3,14 @@ import re
|
||||
import jwt
|
||||
from fastapi import Request
|
||||
|
||||
# Simple in-memory revocation store. In production, consider Redis or database.
|
||||
# Simple in-memory revocation store for revoked JWT tokens.
|
||||
#
|
||||
# Limitations:
|
||||
# - All revoked tokens will be lost if the process restarts (data loss on restart).
|
||||
# - Not suitable for multi-instance deployments: the revocation list is not shared between instances.
|
||||
# A token revoked in one instance will not be recognized as revoked in others.
|
||||
#
|
||||
# For production, use a persistent and shared store (e.g., Redis or a database).
|
||||
_REVOKED_TOKENS: set[str] = set()
|
||||
|
||||
# Bearer token regex
|
||||
|
||||
Reference in New Issue
Block a user