Refactor authentication and session management
- Removed session-based user retrieval from dependencies.py and main.py. - Eliminated SessionMiddleware and related session handling code. - Updated dashboard and team views to directly query user data from the database. - Simplified redeem and team management views to remove authentication checks. - Adjusted templates to reflect changes in user context handling. - Added camera selection feature in scan_qr.html for improved QR code scanning. - Cleaned up Docker configuration and requirements for better deployment.
This commit is contained in:
+2
-8
@@ -33,16 +33,10 @@ services:
|
||||
DB_NAME: "pubquiz_db"
|
||||
DB_USER: "pubquiz_user"
|
||||
DB_PASS: "pubquiz_pass"
|
||||
# Session configuration
|
||||
SECRET_KEY: "a-stronger-secret-key-for-sessions-32chars"
|
||||
DEBUG: "True"
|
||||
SESSION_MAX_AGE: "86400" # 24 hours
|
||||
COOKIE_SECURE: "False" # Set to True in production with HTTPS
|
||||
# Add better error logging
|
||||
PYTHONUNBUFFERED: "1"
|
||||
# Add dependency installation command
|
||||
command: >
|
||||
bash -c "pip install pymysql && uvicorn app.main:app --host 0.0.0.0 --reload"
|
||||
# Just run uvicorn directly, no need for pymysql install since it's in requirements.txt
|
||||
command: uvicorn app.main:app --host 0.0.0.0 --reload
|
||||
ports:
|
||||
- "8000:8000"
|
||||
volumes:
|
||||
|
||||
Reference in New Issue
Block a user