mirror of
https://github.com/ajurna/cbwebreader.git
synced 2025-12-06 06:17:17 +00:00
Add authentication and session management improvements
Some checks failed
Build and push image / deploy (push) Has been cancelled
Some checks failed
Build and push image / deploy (push) Has been cancelled
Introduce navigation guards for authentication and admin access within routes. Replace localStorage usage with secure token storage via httpOnly cookies, and add token blacklisting upon logout. Enhance token refresh mechanism and session expiration handling to improve security and user experience.
This commit is contained in:
@@ -238,8 +238,13 @@ REST_FRAMEWORK = {
|
||||
CORS_ALLOW_ALL_ORIGINS = True
|
||||
SIMPLE_JWT = {
|
||||
"ROTATE_REFRESH_TOKENS": True,
|
||||
"BLACKLIST_AFTER_ROTATION": True,
|
||||
'ACCESS_TOKEN_LIFETIME': timedelta(minutes=10),
|
||||
'LEEWAY': timedelta(minutes=5),
|
||||
'REFRESH_TOKEN_LIFETIME': timedelta(days=1),
|
||||
'LEEWAY': timedelta(seconds=30),
|
||||
'ALGORITHM': 'HS256',
|
||||
'AUDIENCE': 'cbwebreader-users',
|
||||
'ISSUER': 'cbwebreader',
|
||||
}
|
||||
|
||||
FRONTEND_DIR = os.path.join(BASE_DIR, 'frontend')
|
||||
|
||||
Reference in New Issue
Block a user